refactored build process
All checks were successful
the build was successful

This commit is contained in:
Sebastian Frank 2019-02-20 09:02:54 +01:00
parent 0ad79ebd49
commit b38ba11b6b
Signed by: apairon
GPG Key ID: 7270D06DDA7FE8C3
4 changed files with 11 additions and 5 deletions

View File

@ -3,8 +3,12 @@ workspace:
path: src/gitbase.de/apairon/mark2web
pipeline:
build_mark2web:
build_mark2web_linux:
image: golang:latest
environment:
- CGO_ENABLED=0
- GOOS=linux
- GOARCH=amd64
commands:
- ./build.sh
@ -12,8 +16,8 @@ pipeline:
image: alpine
commands:
- ls -la
- ./mark2web -version
- ./mark2web -in website -out html -create -logLevel debug
- ./dist/mark2web-linux-amd64 -version
- ./dist/mark2web-linux-amd64 -in website -out html -create -logLevel debug
build_docker:
image: docker

View File

@ -1,4 +1,4 @@
FROM alpine
RUN apk update && apk add openssh-client sshpass rsync && rm -r /var/cache/
ADD mark2web /
ADD dist/mark2web-linux-amd64 /mark2web
CMD ["/mark2web"]

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.0.0

View File

@ -1,3 +1,4 @@
#!/bin/sh
CGO_ENABLED=0 go build -v -ldflags "-X main.Version=`git describe --tags --long` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`"
mkdir -p dist
go build -v -ldflags "-X main.Version=`cat VERSION` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" -o dist/mark2web-${GOOS}-${GOARCH}${ext}