Edit .drone.yml

This commit is contained in:
an 2017-12-06 19:46:39 +01:00
parent dbe54b048a
commit 92e6249633
3 changed files with 23 additions and 2 deletions

View File

@ -2,8 +2,8 @@ pipeline:
build: build:
image: golang image: golang
commands: commands:
- ./genversion.sh - sh genversion.sh
- ./genbuilddate.sh - sh genbuilddate.sh
- go get -d code.dnix.de/an/flokatilib/... - go get -d code.dnix.de/an/flokatilib/...
- go get -d ./... - go get -d ./...
- go test - go test

9
genbuilddate.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
BUILDDATEGO="builddate.go"
echo "package main" >$BUILDDATEGO
echo "" >>$BUILDDATEGO
echo "const (" >>$BUILDDATEGO
echo -n " FlokatiBuilddate = \"" >>$BUILDDATEGO
echo -n `date` >>$BUILDDATEGO
echo "\"" >>$BUILDDATEGO
echo ")" >>$BUILDDATEGO

12
genversion.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
VERSIONGO="version.go"
echo "package main" >$VERSIONGO
echo "" >>$VERSIONGO
echo "const (" >>$VERSIONGO
echo -n " FlokatiVersion = \"" >>$VERSIONGO
echo -n `git rev-parse --abbrev-ref HEAD` >>$VERSIONGO
echo "\"" >>$VERSIONGO
echo -n " FlokatiBuild = \"" >>$VERSIONGO
echo -n `git rev-list HEAD --count` >>$VERSIONGO
echo "\"" >>$VERSIONGO
echo ")" >>$VERSIONGO