This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
81 lines (79 loc) · 1.87 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
---
kind: pipeline
type: kubernetes
name: Discover GitHub releases
trigger:
event:
exclude:
- promote
steps:
- name: Discover releases
image: golang:1.18.2-alpine
environment:
DURATION: 24h
commands:
- go run ./cmd/discover_releases/main.go
- name: Promote
image: golang:1.18.2-alpine
environment:
DRONE_SERVER: http://drone
DRONE_TOKEN:
from_secret: drone_token
ENVIRONMENT: production
commands:
- apk --no-cache add curl tar
- curl -L https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx
- install -t /usr/local/bin drone
- go run ./cmd/promote/main.go
- cat scripts/promote.sh
- sh scripts/promote.sh
---
kind: pipeline
type: kubernetes
name: Publish
trigger:
event:
- promote
steps:
- name: Clone drone
image: alpine/git
commands:
- git clone --depth 1 --branch $TAG https://github.com/harness/drone.git drone
- name: Build
image: golang:1.14.15
environment:
GOARCH: amd64
GOOS: linux
commands:
- sh scripts/build.sh
- name: Build Docker image
image: plugins/docker
when:
target:
- staging
settings:
dockerfile: docker/Dockerfile.server.linux.amd64
dry_run: true
repo: dockcenter/drone
tags: ${DOCKER_TAGS}
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: Publish Docker image
image: plugins/docker
when:
target:
- production
settings:
dockerfile: docker/Dockerfile.server.linux.amd64
repo: dockcenter/drone
tags: ${DOCKER_TAGS}
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: signature
hmac: 0b6a9e5a0e17675641c66b44d7b398f70ee4e19c087aa7c4c0dd0060466ba102
...