forked from TritonDataCenter/containerpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
69 lines (61 loc) · 1.45 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
kind: pipeline
type: exec
name: exec-runner
platform:
os: linux
arch: amd64
steps:
- name: integration-tests
environment:
commands:
- make clean
- make build lint
- make test
- make integration
when:
event:
- pull_request
- push
---
kind: pipeline
type: docker
name: docker-runner
platform:
os: linux
arch: amd64
steps:
- name: prepare-release
image: golang:1.18
commands:
- |
go build \
-o build/containerpilot \
-ldflags \
"-X github.com/greenbaum/containerpilot/version.GitHash=$(git rev-parse --short HEAD) \
-X github.com/greenbaum/containerpilot/version.Version=${DRONE_TAG}"
- mkdir release && cd build && tar -czf ../release/containerpilot-${DRONE_TAG}.tar.gz containerpilot
- cd ../release && sha1sum containerpilot-${DRONE_TAG}.tar.gz > containerpilot-${DRONE_TAG}.sha1.txt
when:
event:
- tag
- name: publish-release
image: plugins/github-release
settings:
api_key:
from_secret: github_api-key
files:
- release/containerpilot-${DRONE_TAG}.tar.gz
- release/containerpilot-${DRONE_TAG}.sha1.txt
title: "New release: version ${DRONE_TAG}"
base_url: greenbaum/containerpilot
when:
event:
- tag
depends_on:
- prepare-release
---
kind: secret
name: github_api-key
get:
path: secret/data/drone/github
name: api-key