2018-02-20 22:59:52 +00:00
|
|
|
pipeline:
|
2018-02-22 21:37:56 +00:00
|
|
|
prebuild:
|
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 21:37:56 +00:00
|
|
|
build_docker:
|
2018-02-22 18:29:28 +00:00
|
|
|
image: plugins/docker
|
|
|
|
environment:
|
|
|
|
- REV=$(git rev-list HEAD --count)
|
2018-02-22 21:25:40 +00:00
|
|
|
repo: dr.dnix.de/mmflokati
|
2018-02-22 21:37:56 +00:00
|
|
|
tags:
|
|
|
|
- latest
|
|
|
|
- ${REV}
|
2018-02-22 18:49:15 +00:00
|
|
|
deploy:
|
|
|
|
image: ubuntu:16.04
|
|
|
|
commands:
|
|
|
|
- echo "foo"
|
2018-02-22 17:15:55 +00:00
|
|
|
|