forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
98 lines (83 loc) · 2.02 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
kind: pipeline
type: kubernetes
name: default
workspace:
base: /go
path: /go/src/github.com/cyrusbiotechnology/argo
steps:
- name: submodules
image: alpine/git
environment:
SSH_KEY:
from_secret: github_ssh
commands:
# write the ssh key to disk
- mkdir /root/.ssh
- echo -n "$SSH_KEY" > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
# add github to known hosts
- touch /root/.ssh/known_hosts
- chmod 600 /root/.ssh/known_hosts
- ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null
- git submodule update --init --recursive
- name: get version - master
image: ubuntu:latest
commands:
- echo $(cat VERSION) > .tags
when:
branch:
- master
- name: get version - feature-branch
image: ubuntu:latest
commands:
- echo $(cat VERSION)-$(echo $DRONE_COMMIT_BRANCH | sed 's/[/_-]//g')-$DRONE_BUILD_NUMBER > .tags
- echo $(cat .tags)
when:
branch:
exclude:
- master
- name: run tests
image: golang:latest
commands:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure -vendor-only -v
- go test ./...
- name: build argo cli
image: golang
commands:
- CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o argo-cli-linux cmd/argo/main.go
- CGO_ENABLED=0 GOOS=darwin go build -a -ldflags '-extldflags "-static"' -o argo-cli-osx cmd/argo/main.go
- name: build + publish controller to gcr
image: plugins/gcr
settings:
repo: cyrus-containers/workflow-controller
target: workflow-controller
debug: true
json_key:
from_secret: dockerconfigjson
- name: build + publish executor to gcr
image: plugins/gcr
settings:
repo: cyrus-containers/argoexec
target: argoexec
debug: true
json_key:
from_secret: dockerconfigjson
- name: release
image: plugins/github-release
settings:
files:
- argo-cli-linux
- argo-cli-osx
checksum:
- sha256
api_key:
from_secret: github_token
when:
event: tag
node_selector:
CPUs: 8
volumes:
- name: dockersock
temp: {}