Pipeline now uses two seperate configs to handle tags and pushes to master

This commit is contained in:
konrad 2019-01-16 23:07:43 +01:00
parent 0db5292f9f
commit 20c4b249a4
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 143 additions and 25 deletions

View File

@ -77,9 +77,13 @@ steps:
event: [ push, tag, pull_request ]
---
# Build a release when tagging
########
# Build a release when pushing to master
# We need to copy this because drone currently can't run a pipeline on either a push to master or a tag.
########
kind: pipeline
name: deploy
name: deploy-master
depends_on:
- testing
@ -95,6 +99,132 @@ trigger:
- master
event:
- push
steps:
- name: before-static-build
image: karalabe/xgo-latest:latest
pull: true
commands:
- make release-dirs
- name: static-build-windows
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-windows
depends_on: [ before-static-build ]
- name: static-build-linux
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-linux
depends_on: [ before-static-build ]
- name: static-build-darwin
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-darwin
depends_on: [ before-static-build ]
- name: after-build-static
image: karalabe/xgo-latest:latest
pull: true
depends_on:
- static-build-windows
- static-build-linux
- static-build-darwin
commands:
- make release-copy
- make release-check
- make release-os-package
- make release-zip
- name: sign-release
image: plugins/gpgsign:1
pull: true
depends_on: [ after-build-static ]
settings:
key:
from_secret: gpg_privkey
passphrase:
from_secret: gpg_password
files:
- dist/zip/*
detach_sign: true
# Push the releases to our pseudo-s3-bucket
- name: release-latest
image: plugins/s3:1
pull: true
settings:
bucket: vikunja
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/zip/
source: dist/zip/*
target: /master/
depends_on: [ sign-release ]
# Build the docker image and push it to docker hub
- name: docker
image: plugins/docker
pull: true
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/api
auto_tag: true
# Update the instance on try.vikunja.io
- name: rancher
image: peloton/drone-rancher
settings:
url: http://server01.kolaente.de:8080/v1
access_key:
from_secret: RANCHER_ACCESS_KEY
secret_key:
from_secret: RANCHER_SECRET_KEY
service: vikunja-dev/api
docker_image: vikunja/api
confirm: true
depends_on: [ docker ]
---
########
# Build a release when tagging
# We need to copy this because drone currently can't run a pipeline on either a push to master or a tag.
########
kind: pipeline
name: deploy-version
depends_on:
- testing
workspace:
base: /srv/app
path: src/code.vikunja.io/api
clone:
depth: 50
trigger:
event:
- tag
steps:
@ -102,8 +232,6 @@ steps:
image: docker:git
commands:
- git fetch --tags
when:
event: [ tag ]
- name: before-static-build
image: karalabe/xgo-latest:latest
@ -183,27 +311,6 @@ steps:
source: dist/zip/*
target: /${DRONE_TAG##v}/
depends_on: [ sign-release ]
when:
event: [ tag ]
- name: release-latest
image: plugins/s3:1
pull: true
settings:
bucket: vikunja
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/zip/
source: dist/zip/*
target: /master/
depends_on: [ sign-release ]
when:
event: [ push ]
branch: [ master ]
# Build the docker image and push it to docker hub
- name: docker
@ -231,7 +338,18 @@ steps:
confirm: true
depends_on: [ docker ]
---
#############
# Tell people vikunja was updated
#############
kind: pipeline
name: notify
depends_on:
- deploy-version
- deploy-master
steps:
- name: telegram
image: appleboy/drone-telegram
settings: