2019-04-27 09:03:42 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: testing
|
|
|
|
|
2018-11-29 00:16:11 +00:00
|
|
|
workspace:
|
2019-04-27 09:03:42 +00:00
|
|
|
base: /go
|
2018-11-29 00:16:11 +00:00
|
|
|
path: src/git.kolaente.de/sofaraum/client
|
|
|
|
|
2019-04-27 09:03:42 +00:00
|
|
|
steps:
|
|
|
|
- name: build
|
2018-11-29 00:16:11 +00:00
|
|
|
image: vikunja/golang-build:latest
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- make lint
|
|
|
|
- make fmt-check
|
|
|
|
- make ineffassign-check
|
|
|
|
- make misspell-check
|
|
|
|
- make build
|
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2019-04-27 09:03:42 +00:00
|
|
|
- name: test
|
|
|
|
image: vikunja/golang-build:latest
|
2018-11-29 00:16:11 +00:00
|
|
|
pull: true
|
|
|
|
commands:
|
2019-04-27 09:03:42 +00:00
|
|
|
- make test
|
|
|
|
depends_on: [ build ]
|
2018-11-29 00:16:11 +00:00
|
|
|
when:
|
2019-04-27 09:03:42 +00:00
|
|
|
event: [ push, tag, pull_request ]
|
2018-11-29 00:16:11 +00:00
|
|
|
|
2019-04-27 09:03:42 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: deploy-master
|
2019-04-27 09:40:38 +00:00
|
|
|
depends_on:
|
|
|
|
- testing
|
2018-11-29 00:16:11 +00:00
|
|
|
|
2019-04-27 09:03:42 +00:00
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/git.kolaente.de/sofaraum/client
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# Needed to get the versions right as they depend on tags
|
|
|
|
- name: fetch-tags
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
|
|
|
- name: static
|
|
|
|
image: techknowlogick/xgo:latest
|
|
|
|
pull: true
|
2019-04-27 09:19:17 +00:00
|
|
|
environment:
|
2019-04-27 09:40:38 +00:00
|
|
|
# This path does not exist. However, when we set the gopath to /go, the build fails. Not sure why.
|
|
|
|
# Leaving this here until we know how to resolve this properly.
|
2019-04-27 09:32:01 +00:00
|
|
|
GOPATH: /srv/app
|
2019-04-27 09:03:42 +00:00
|
|
|
commands:
|
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
|
|
- make release
|
|
|
|
|
|
|
|
# Push the releases to our pseudo-s3-bucket
|
2019-04-27 09:07:55 +00:00
|
|
|
- name: release
|
2018-11-29 00:16:11 +00:00
|
|
|
image: plugins/s3:1
|
|
|
|
pull: true
|
2019-04-27 09:03:42 +00:00
|
|
|
settings:
|
|
|
|
bucket: sofaraum-client
|
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
endpoint: https://storage.kolaente.de
|
|
|
|
path_style: true
|
|
|
|
strip_prefix: dist/binaries/
|
|
|
|
source: dist/binaries/*
|
|
|
|
target: /master/
|
|
|
|
depends_on: [ static ]
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: deploy-version
|
|
|
|
depends_on:
|
|
|
|
- testing
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/git.kolaente.de/sofaraum/client
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
2019-04-27 09:05:33 +00:00
|
|
|
- tag
|
2018-11-29 00:16:11 +00:00
|
|
|
|
2019-04-27 09:03:42 +00:00
|
|
|
steps:
|
|
|
|
# Needed to get the versions right as they depend on tags
|
|
|
|
- name: fetch-tags
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
|
|
|
- name: static
|
|
|
|
image: techknowlogick/xgo:latest
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
|
|
- make release
|
|
|
|
|
|
|
|
# Push the releases to our pseudo-s3-bucket
|
2019-04-27 09:07:55 +00:00
|
|
|
- name: release
|
2018-11-29 00:16:11 +00:00
|
|
|
image: plugins/s3:1
|
|
|
|
pull: true
|
2019-04-27 09:03:42 +00:00
|
|
|
settings:
|
|
|
|
bucket: sofaraum-client
|
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
endpoint: https://storage.kolaente.de
|
|
|
|
path_style: true
|
|
|
|
strip_prefix: dist/binaries/
|
|
|
|
source: dist/binaries/*
|
|
|
|
target: /${DRONE_TAG##v}
|
|
|
|
depends_on: [ static ]
|