From 85126799de20a3ce507b0c22299a67d08b07d04d Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Wed, 20 Feb 2019 10:57:48 +0100 Subject: [PATCH] .drone.yml git clone config --- .drone.yml | 46 +++++++++++++++++++--------------------------- build.sh | 2 +- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7cdcb60..1ff3179 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,12 @@ workspace: base: /go path: src/gitbase.de/apairon/mark2web +clone: + git: + image: plugins/git:next + depth: 50 + tags: true + pipeline: build_mark2web_linux: image: golang:latest @@ -27,10 +33,8 @@ pipeline: commands: - ./build.sh when: - branch: master - event: - - push - - tag + branch: [ master ] + event: [ push, tag ] build_mark2web_darwin: image: golang:latest @@ -41,10 +45,8 @@ pipeline: commands: - ./build.sh when: - branch: master - event: - - push - - tag + branch: [ master ] + event: [ push] build_mark2web_windows: image: golang:latest @@ -56,10 +58,8 @@ pipeline: commands: - ./build.sh when: - branch: master - event: - - push - - tag + branch: [ master ] + event: [ push, tag ] build_docker: image: docker @@ -69,10 +69,8 @@ pipeline: volumes: - /var/run/docker.sock:/var/run/docker.sock when: - branch: master - event: - - push - - tag + branch: [ master ] + event: [ push, tag ] deploy_website: image: apairon/mark2web:latest @@ -80,10 +78,8 @@ pipeline: - /mark2web -version - /mark2web -in website -out html -create -logLevel debug when: - branch: master - event: - - push - - tag + branch: [ master ] + event: [ push, tag ] prepare_release: image: apairon/mark2web:latest @@ -91,13 +87,11 @@ pipeline: - gzip dist/* - ls -la dist/ when: - branch: master - event: - - push - - tag + event: [ tag ] gitea_relase: image: plugins/gitea-release + secrets: [ plugin_api_key ] base_url: https://gitbase.de files: - dist/* @@ -107,6 +101,4 @@ pipeline: - md5 - sha256 when: - branch: master - event: - - tag \ No newline at end of file + event: [ tag ] diff --git a/build.sh b/build.sh index bacd9ca..0b99f38 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/sh 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-`cat VERSION`-${GOOS}-${GOARCH}${FILEEXT} +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'`" -o dist/mark2web-`cat VERSION`-${GOOS}-${GOARCH}${FILEEXT}