mmflokati/.drone.yml

29 lines
928 B
YAML
Raw Normal View History

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 16:48:04 +00:00
- FOO=1
2018-02-20 22:59:52 +00:00
commands:
2018-02-22 17:15:55 +00:00
- export REV=$(git rev-list HEAD --count)
- export BUILDDATE=$(date)
- export BRANCH=$DRONE_COMMIT_BRANCH
- export IMAGE=dr.dnix.de/$DRONE_REPO_NAME
- export VERSIONGO=version.go
- 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