mark2web/.drone.yml

123 lines
2.6 KiB
YAML
Raw Normal View History

2019-02-20 11:58:41 +01:00
kind: pipeline
name: default
2019-02-14 13:54:08 +01:00
2019-02-20 12:02:10 +01:00
workspace:
base: /go
path: src/gitbase.de/apairon/mark2web
2019-02-20 11:58:41 +01:00
steps:
- name: build for linux
2019-02-14 13:54:08 +01:00
image: golang:latest
2019-02-20 09:02:54 +01:00
environment:
2019-02-20 11:58:41 +01:00
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
2019-02-14 13:54:08 +01:00
commands:
2019-02-20 11:58:41 +01:00
- git submodule update --init --recursive
2019-02-20 11:21:21 +01:00
- git fetch --tags
2019-02-18 13:12:18 +01:00
- ./build.sh
2019-03-04 16:43:46 +01:00
when:
event: [ push, tag ]
2019-02-14 13:54:08 +01:00
2019-02-20 11:58:41 +01:00
- name: test with example content
2019-02-14 13:54:08 +01:00
image: alpine
commands:
2019-02-20 09:55:17 +01:00
- ./dist/mark2web-`cat VERSION`-linux-amd64 -version
- ./dist/mark2web-`cat VERSION`-linux-amd64 -in example -out example_out -create -logLevel debug
2019-03-04 16:43:46 +01:00
when:
event: [ push, tag ]
2019-02-20 09:12:25 +01:00
2019-02-20 11:58:41 +01:00
- name: build for freebsd
2019-02-20 09:12:25 +01:00
image: golang:latest
environment:
2019-02-20 11:58:41 +01:00
CGO_ENABLED: 0
GOOS: freebsd
GOARCH: amd64
2019-02-20 09:12:25 +01:00
commands:
- ./build.sh
when:
2019-02-20 11:37:59 +01:00
event: [ tag ]
2019-02-20 09:12:25 +01:00
2019-02-20 11:58:41 +01:00
- name: build for macos
2019-02-20 09:54:10 +01:00
image: golang:latest
environment:
2019-02-20 11:58:41 +01:00
CGO_ENABLED: 0
GOOS: darwin
GOARCH: amd64
2019-02-20 09:54:10 +01:00
commands:
- ./build.sh
when:
2019-02-20 11:37:59 +01:00
event: [ tag ]
2019-02-20 09:54:10 +01:00
2019-02-20 11:58:41 +01:00
- name: build for windows
2019-02-20 09:12:25 +01:00
image: golang:latest
environment:
2019-02-20 11:58:41 +01:00
CGO_ENABLED: 0
GOOS: windows
GOARCH: amd64
FILEEXT: .exe
2019-02-20 09:12:25 +01:00
commands:
- ./build.sh
when:
2019-02-20 11:37:59 +01:00
event: [ tag ]
2019-02-14 14:21:17 +01:00
2019-02-20 11:58:41 +01:00
- name: build docker image
2019-02-14 14:21:17 +01:00
image: docker
commands:
2019-02-20 09:59:03 +01:00
- cp dist/mark2web-`cat VERSION`-linux-amd64 mark2web
2019-02-14 14:21:17 +01:00
- docker build -t apairon/mark2web .
volumes:
2019-02-20 11:59:57 +01:00
- name: docker
path: /var/run/docker.sock
2019-02-14 14:21:17 +01:00
when:
2019-02-20 10:57:48 +01:00
branch: [ master ]
2019-02-20 11:37:59 +01:00
event: [ push ]
2019-02-20 09:12:25 +01:00
2019-02-20 11:58:41 +01:00
- name: deploy website
2019-02-20 09:12:25 +01:00
image: apairon/mark2web:latest
pull: never
2019-02-20 13:10:09 +01:00
environment:
RSYNC_PASS:
from_secret: rsync_pass
2019-02-20 09:12:25 +01:00
commands:
- /mark2web -version
- /mark2web -in website -out html -create -logLevel debug
2019-02-20 13:10:09 +01:00
- '
rsync -rlcgD -i -u -v --stats --progress
--delete
2019-02-20 13:15:25 +01:00
-e "sshpass -p $${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 22222"
2019-02-20 13:10:09 +01:00
html/
basiskonfiguration_mark2web_rsync@deploy.bc1.basehosts.de:./'
2019-02-20 09:12:25 +01:00
when:
2019-02-20 10:57:48 +01:00
branch: [ master ]
2019-03-04 16:43:46 +01:00
event: [ promote, push ]
2019-02-20 09:12:25 +01:00
2019-02-20 11:58:41 +01:00
- name: prepare release
2019-02-20 09:12:25 +01:00
image: apairon/mark2web:latest
pull: never
2019-02-20 09:12:25 +01:00
commands:
- gzip dist/*
- ls -la dist/
2019-02-20 10:39:19 +01:00
when:
2019-02-20 10:57:48 +01:00
event: [ tag ]
2019-02-20 09:12:25 +01:00
2019-02-20 11:58:41 +01:00
- name: gitea release
2019-02-20 09:54:10 +01:00
image: plugins/gitea-release
2019-02-20 11:58:41 +01:00
settings:
api_key:
from_secret: gitea_token
base_url: https://gitbase.de
files:
- dist/*
title: VERSION
2019-02-20 12:31:10 +01:00
note: RELEASE.md
2019-02-20 11:58:41 +01:00
checksum:
- md5
- sha256
2019-02-20 09:54:10 +01:00
when:
2019-02-20 10:57:48 +01:00
event: [ tag ]
2019-02-20 11:59:57 +01:00
volumes:
- name: docker
host:
path: /var/run/docker.sock