Use a static mage build to avoid race conditions
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2020-09-03 15:52:54 +02:00
parent 22837bd106
commit 49afd00989
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 70 additions and 49 deletions

View File

@ -52,13 +52,24 @@ steps:
commands:
- git fetch --tags
- name: build
- name: mage
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage build:build
- mage -compile ./mage-static
when:
event: [ push, tag, pull_request ]
- name: build
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ mage ]
commands:
- ./mage-static build:build
when:
event: [ push, tag, pull_request ]
@ -69,17 +80,17 @@ steps:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ build ]
commands:
- mage build:generate
- mage check:lint
- mage check:fmt
- mage check:got-swag
- mage check:ineffassign
- mage check:misspell
- mage check:goconst
- mage check:gocyclo
- mage check:static
- ./mage-static build:generate
- ./mage-static check:lint
- ./mage-static check:fmt
- ./mage-static check:got-swag
- ./mage-static check:ineffassign
- ./mage-static check:misspell
- ./mage-static check:goconst
- ./mage-static check:gocyclo
- ./mage-static check:static
- wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $GOPATH/bin v2.2.0 # Need to manually install as it does not support being installed via go modules like the rest.
- mage check:gosec
- ./mage-static check:gosec
when:
event: [ push, tag, pull_request ]
@ -152,9 +163,9 @@ steps:
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage build:generate
- mage test:unit
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:unit
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -166,9 +177,9 @@ steps:
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
commands:
- mage build:generate
- mage test:unit
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:unit
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -184,9 +195,9 @@ steps:
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- mage build:generate
- mage test:unit
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:unit
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -203,9 +214,9 @@ steps:
VIKUNJA_DATABASE_DATABASE: vikunjatest
VIKUNJA_DATABASE_SSLMODE: disable
commands:
- mage build:generate
- mage test:unit
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:unit
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -215,9 +226,9 @@ steps:
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage build:generate
- mage test:integration
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:integration
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -229,9 +240,9 @@ steps:
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
commands:
- mage build:generate
- mage test:integration
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:integration
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -247,9 +258,9 @@ steps:
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- mage build:generate
- mage test:integration
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:integration
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -266,9 +277,9 @@ steps:
VIKUNJA_DATABASE_DATABASE: vikunjatest
VIKUNJA_DATABASE_SSLMODE: disable
commands:
- mage build:generate
- mage test:integration
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static test:integration
depends_on: [ fetch-tags mage ]
when:
event: [ push, tag, pull_request ]
@ -299,15 +310,25 @@ steps:
commands:
- git fetch --tags
- name: mage
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage -compile ./mage-static
when:
event: [ push, tag, pull_request ]
- name: before-static-build
image: techknowlogick/xgo:latest
pull: true
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- mage build:generate
- mage release:dirs
depends_on: [ fetch-tags ]
- ./mage-static build:generate
- ./mage-static release:dirs
depends_on: [ fetch-tags mage ]
- name: static-build-windows
image: techknowlogick/xgo:latest
@ -319,7 +340,7 @@ steps:
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- mage release:windows
- ./mage-static release:windows
depends_on: [ before-static-build ]
- name: static-build-linux
@ -332,7 +353,7 @@ steps:
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- mage release:linux
- ./mage-static release:linux
depends_on: [ before-static-build ]
- name: static-build-darwin
@ -345,7 +366,7 @@ steps:
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- mage release:darwin
- ./mage-static release:darwin
depends_on: [ before-static-build ]
- name: after-build-compress
@ -356,7 +377,7 @@ steps:
- static-build-linux
- static-build-darwin
commands:
- mage release:compress
- ./mage-static release:compress
- name: after-build-static
image: techknowlogick/xgo:latest
@ -365,10 +386,10 @@ steps:
- after-build-compress
commands:
- go install github.com/magefile/mage
- mage release:copy
- mage release:check
- mage release:os-package
- mage release:zip
- ./mage-static release:copy
- ./mage-static release:check
- ./mage-static release:os-package
- ./mage-static release:zip
- name: sign-release
image: plugins/gpgsign:1
@ -433,7 +454,7 @@ steps:
image: kolaente/fpm
pull: true
commands:
- make build-deb
- ./mage-static build-deb
depends_on: [ static-build-linux ]
- name: deb-structure
@ -451,7 +472,7 @@ steps:
- gpg --import ~/frederik.gpg
- mkdir debian/conf -p
- cp build/reprepro-dist-conf debian/conf/distributions
- make reprepro
- ./mage-static reprepro
depends_on: [ build-deb ]
# Push the releases to our pseudo-s3-bucket