Updated drone config to work with Drone 1

This commit is contained in:
konrad 2019-04-27 11:03:42 +02:00
parent 3d3c2cee15
commit 2c43925c56
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 99 additions and 50 deletions

View File

@ -1,18 +1,14 @@
kind: pipeline
name: testing
workspace:
base: /srv/app
base: /go
path: src/git.kolaente.de/sofaraum/client
clone:
git:
image: plugins/git
depth: 50
tags: true
pipeline:
build:
steps:
- name: build
image: vikunja/golang-build:latest
pull: true
group: build
commands:
- make lint
- make fmt-check
@ -22,52 +18,105 @@ pipeline:
when:
event: [ push, tag, pull_request ]
test:
image: vikunja/golang-build:latest
pull: true
commands:
- make test
when:
event: [ push, tag, pull_request ]
# Build a release when tagging
static:
image: karalabe/xgo-latest:latest
- name: test
image: vikunja/golang-build:latest
pull: true
group: build-static
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make test
depends_on: [ build ]
when:
event: [ push, tag, pull_request ]
---
kind: pipeline
name: deploy-master
depends_on:
- testing
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
commands:
- export PATH=$PATH:$GOPATH/bin
- make release
when:
event: [tag, push]
# Push the releases to our pseudo-s3-bucket
release:
# Push the releases to our pseudo-s3-bucket
- name: release-latest
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: sofaraum-client
endpoint: https://storage.kolaente.de
path_style: true
strip_prefix: dist/binaries/
source: dist/binaries/*
target: /${DRONE_TAG##v}
when:
event: [ tag ]
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 ]
release:
---
kind: pipeline
name: deploy-version
depends_on:
- testing
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
commands:
- export PATH=$PATH:$GOPATH/bin
- make release
# Push the releases to our pseudo-s3-bucket
- name: release-latest
image: plugins/s3:1
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: sofaraum-client
endpoint: https://storage.kolaente.de
path_style: true
strip_prefix: dist/binaries/
source: dist/binaries/*
target: /master
when:
event: [ push ]
branch: [ master ]
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 ]