2018-02-20 22:59:52 +00:00
|
|
|
pipeline:
|
|
|
|
build:
|
2018-02-22 16:50:02 +00:00
|
|
|
image: golang:1.9
|
2018-02-20 22:59:52 +00:00
|
|
|
environment:
|
2018-02-22 18:29:28 +00:00
|
|
|
- IMAGE=dr.dnix.de/$DRONE_REPO_NAME
|
2018-02-20 22:59:52 +00:00
|
|
|
commands:
|
2018-02-22 18:01:39 +00:00
|
|
|
- REV=$(git rev-list HEAD --count)
|
|
|
|
- BUILDDATE=$(date)
|
|
|
|
- BRANCH=$DRONE_COMMIT_BRANCH
|
|
|
|
- VERSIONGO=version.go
|
2018-02-22 17:15:55 +00:00
|
|
|
- echo "Building image $IMAGE:$BRANCH-$REV"
|
|
|
|
- echo "package main" >$VERSIONGO
|
|
|
|
- echo "" >>$VERSIONGO
|
|
|
|
- echo "const (" >>$VERSIONGO
|
|
|
|
- echo -n " FlokatiVersion = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$BRANCH" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo -n " FlokatiBuild = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$REV" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo -n " FlokatiBuilddate = \"" >>$VERSIONGO
|
|
|
|
- echo -n "$BUILDDATE" >>$VERSIONGO
|
|
|
|
- echo "\"" >>$VERSIONGO
|
|
|
|
- echo ")" >>$VERSIONGO
|
2018-02-22 17:49:11 +00:00
|
|
|
- cat version.go
|
2018-02-22 16:43:08 +00:00
|
|
|
- go get -d ./...
|
2018-02-22 17:15:55 +00:00
|
|
|
- go build
|
2018-02-22 18:29:28 +00:00
|
|
|
publish:
|
|
|
|
image: plugins/docker
|
|
|
|
environment:
|
|
|
|
- IMAGE=dr.dnix.de/$DRONE_REPO_NAME
|
|
|
|
- REV=$(git rev-list HEAD --count)
|
|
|
|
repo: $IMAGE
|
|
|
|
tags: [ $REV, latest ]
|
2018-02-22 18:49:15 +00:00
|
|
|
deploy:
|
|
|
|
image: ubuntu:16.04
|
|
|
|
commands:
|
|
|
|
- echo "foo"
|
2018-02-22 17:15:55 +00:00
|
|
|
|