Library/.drone.yml

168 lines
3.7 KiB
YAML
Raw Permalink Normal View History

workspace:
base: /srv/app
2018-03-05 11:53:12 +00:00
path: src/git.kolaente.de/konrad/Library
2018-01-10 13:58:17 +00:00
clone:
git:
2018-01-10 14:04:07 +00:00
image: plugins/git
depth: 50
tags: true
2018-01-10 13:58:17 +00:00
pipeline:
2017-11-08 20:51:53 +00:00
build-backend:
image: webhippie/golang:edge
pull: true
2017-11-09 14:14:28 +00:00
group: build
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
2017-11-07 15:29:41 +00:00
- make clean
- make lint
- make fmt-check
- make build
when:
event: [ push, tag, pull_request ]
2017-11-08 20:51:53 +00:00
build-frontend:
2018-03-05 10:09:41 +00:00
image: node:latest
2017-11-08 20:51:53 +00:00
pull: true
2017-11-09 14:14:28 +00:00
group: build
2017-11-08 20:51:53 +00:00
commands:
2017-11-09 14:14:28 +00:00
- cd frontend/
- rm siteconfig.json
- "echo '{\"API_URL\": \"/api/v1/\"}' > siteconfig.json"
2017-11-08 20:51:53 +00:00
- npm install
2018-01-10 12:11:19 +00:00
- npm run build
2017-11-08 20:51:53 +00:00
when:
event: [ push, tag, pull_request ]
2017-11-08 20:51:53 +00:00
2018-01-16 10:41:11 +00:00
test-backend:
image: webhippie/golang:edge
pull: true
environment:
GOPATH: /srv/app
commands:
- make test
when:
event: [ push, tag, pull_request ]
2018-01-10 09:16:12 +00:00
# Build a release when tagging
before-static-build:
2018-01-10 09:16:12 +00:00
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-dirs
when:
event: [tag, push]
static-build-windows:
image: karalabe/xgo-latest:latest
pull: true
group: build-static
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-windows
when:
event: [tag, push]
static-build-linux:
image: karalabe/xgo-latest:latest
pull: true
group: build-static
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-linux
when:
event: [tag, push]
static-build-darwin:
image: karalabe/xgo-latest:latest
pull: true
group: build-static
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-darwin
when:
event: [tag, push]
# static-build-frontend:
# image: webhippie/nodejs:current
# pull: true
# group: build-static
# commands:
# - make release-frontend
# when:
# event: [push, tag ]
after-build-static:
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release-copy
- make release-check
- make release-os-package
- make release-zip
2018-01-10 09:16:12 +00:00
when:
2018-01-11 11:28:58 +00:00
event: [tag, push]
2018-01-10 09:16:12 +00:00
# Push the releases to our pseudo-s3-bucket
release:
image: plugins/s3:1
2018-01-10 09:16:12 +00:00
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: library-release
endpoint: https://storage.kolaente.de
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /${DRONE_TAG##v}
2018-01-10 09:16:12 +00:00
when:
event: [ tag ]
2018-01-10 14:03:17 +00:00
release:
image: plugins/s3:1
2018-01-10 14:03:17 +00:00
pull: true
secrets: [ aws_access_key_id, aws_secret_access_key ]
bucket: library-release
endpoint: https://storage.kolaente.de
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /master
2018-01-10 14:03:17 +00:00
when:
event: [ push ]
branch: [ master ]
# release-minio:
# image: minio/mc
# pull: true
# secrets: [ aws_access_key_id, aws_secret_access_key ]
# commands:
2018-01-11 11:28:58 +00:00
# - mc config host add minio https://storage.kolaente.de $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY S3v4 --insecure
# - mc cp dist/release/* library-release/master/ -r --insecure
# when:
# event: [ push ]
# branch: [ master ]
# release-minio:
# image: minio/mc
# pull: true
# secrets: [ aws_access_key_id, aws_secret_access_key ]
# commands:
# - mc config host add minio https://storage.kolaente.de $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY S3v4 --insecure
# - mc cp dist/release/* library-release/${DRONE_TAG##v}/ -r --insecure
# when:
# event: [ tag ]