2019-08-01 08:50:53 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
2019-08-02 09:16:10 +00:00
|
|
|
- name: pre-build
|
2019-08-01 08:50:53 +00:00
|
|
|
image: golang:latest
|
|
|
|
commands:
|
|
|
|
- IMAGE=dr.dnix.de/$DRONE_REPO_NAME
|
|
|
|
- REV=$(git rev-list HEAD --count)
|
|
|
|
- BUILDDATE=$(date)
|
|
|
|
- BRANCH=$DRONE_COMMIT_BRANCH
|
|
|
|
- VERSIONGO=version.go
|
|
|
|
- TAGS=.tags
|
|
|
|
- echo "Building image $IMAGE:$BRANCH-$REV"
|
|
|
|
- echo "package main" >$VERSIONGO
|
|
|
|
- echo "" >>$VERSIONGO
|
|
|
|
- echo "const (" >>$VERSIONGO
|
|
|
|
- echo -n " Version = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$BRANCH" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo -n " Build = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$REV" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo -n " Builddate = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$BUILDDATE" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo ")" >>$VERSIONGO
|
|
|
|
- cat $VERSIONGO
|
|
|
|
- echo -n "$BRANCH-$REV" >$TAGS
|
|
|
|
|
|
|
|
- name: docker
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: dr.dnix.de/flokati
|
|
|
|
registry: dr.dnix.de
|
|
|
|
auto_tag: true
|
|
|
|
tags: latest
|
2019-08-02 09:02:33 +00:00
|
|
|
|
|
|
|
- name: clair
|
2019-08-02 09:26:36 +00:00
|
|
|
image: ubuntu:18.04
|
|
|
|
commands:
|
2019-08-02 09:31:05 +00:00
|
|
|
- apt update -y
|
|
|
|
- apt -y install curl
|
2019-08-02 09:47:32 +00:00
|
|
|
- curl -L -o /usr/local/bin/klar https://github.com/optiopay/klar/releases/download/v2.4.0/klar-2.4.0-linux-amd64
|
2019-08-02 09:26:36 +00:00
|
|
|
- chmod -x /usr/local/bin/klar
|
|
|
|
- CLAIR_ADDR=dev01:6060 CLAIR_OUTPUT=High CLAIR_THRESHOLD=10 REGISTRY_INSECURE=true klar dr.dnix.de/flokati:latest
|