-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
75 lines (68 loc) · 2.16 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
platform: linux/arm
workspace:
base: /go
path: src/git.maurer-it.net/abaeve/chremoas-command-template
clone:
default:
image: plugins/git:linux-arm
depth: 50
tags: true
pipeline:
build:
image: registry.maurer-it.net/golang-1.8
commands:
- go get -t -v ./...
- go get github.com/mattn/goveralls
# - goveralls -service=drone.io -ignore=discord/discord.go,main.go -repotoken=${repotoken}
- CGO_ENABLED=0 go build -ldflags "-X main.Version=$(git describe --abbrev=0 --tags)-${DRONE_BUILD_NUMBER}-$(git rev-parse --short HEAD)" -o template .
publish:
image: plugins/docker:linux-arm
repo: registry.maurer-it.net/chremoas-command-template
registry: registry.maurer-it.net
secrets:
- source: registry_user
target: PLUGIN_USERNAME
- source: registry_pass
target: PLUGIN_PASSWORD
tags: [ latest, 1.0.0 ]
when:
branch: [ tag ]
publish-snapshot:
image: plugins/docker:linux-arm
repo: registry.maurer-it.net/chremoas-command-template
registry: registry.maurer-it.net
secrets:
- source: registry_user
target: PLUGIN_USERNAME
- source: registry_pass
target: PLUGIN_PASSWORD
tags: [ latest, 1.0.0-SNAPSHOT ]
when:
branch: [ release/* ]
deploy-test:
image: registry.maurer-it.net/drone-ssh
host: docker1.home
username: pi
secrets:
- source: SSH_KEY
target: ssh_key
port: 22
script:
- docker login -u ${registry_user} -p ${registry_pass} registry.maurer-it.net
- docker service update --with-registry-auth --image=registry.maurer-it.net/chremoas-command-template:1.0.0-SNAPSHOT template-dev
when:
branch: [ release/* ]
deploy-prod:
image: registry.maurer-it.net/drone-ssh
host: docker1.home
username: pi
secrets:
- source: SSH_KEY
target: ssh_key
port: 22
script:
- docker login -u ${registry_user} -p ${registry_pass} registry.maurer-it.net
- docker service create --name template --network chremoas --with-registry-auth registry.maurer-it.net/chremoas-command-template:1.0.0
when:
event: deployment
environment: production