-
Notifications
You must be signed in to change notification settings - Fork 56
/
.drone.yml
126 lines (126 loc) · 3.18 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
kind: pipeline
type: docker
name: build-amd64
platform:
os: linux
arch: amd64
steps:
- name: setup-dagger-engine
image: &image cimg/go:1.21
user: root
commands:
- |
docker run \
--name dagger-engine \
--privileged \
--stop-signal SIGTERM \
-d \
-e _EXPERIMENTAL_DAGGER_CACHESERVICE_TOKEN=$_EXPERIMENTAL_DAGGER_CACHESERVICE_TOKEN \
-e _EXPERIMENTAL_DAGGER_CACHESERVICE_URL=https://api.dagger.cloud/magicache \
-v dagger-engine:/var/lib/dagger \
registry.dagger.io/engine:v0.8.7
volumes: &volumes
- name: docker-sock
path: /var/run/docker.sock
- name: docker-config
path: /root/.docker
environment:
_EXPERIMENTAL_DAGGER_CACHESERVICE_TOKEN:
from_secret: dagger_cacheservice_token
- name: build-and-package
image: *image
user: root
environment: &environment
_EXPERIMENTAL_DAGGER_CACHESERVICE_TOKEN:
from_secret: dagger_cacheservice_token
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
from_secret: dagger_cloud_token
_EXPERIMENTAL_DAGGER_RUNNER_HOST: docker-container://dagger-engine
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
GH_TOKEN:
from_secret: github_token
volumes: *volumes
commands:
- go run ./dagger -c dagger/ci/defaults
when:
instance:
- drone-publish.rancher.io
- name: build-and-package-pr
image: *image
user: root
environment: *environment
volumes: *volumes
commands:
- go run ./dagger -c dagger/ci/defaults --coverage.export=true
when:
instance:
- drone-pr.rancher.io
- name: publish-tag
image: *image
user: root
environment: *environment
volumes: *volumes
commands:
- go run ./dagger -c dagger/ci/defaults,dagger/ci/push,dagger/ci/push-charts,dagger/ci/tag-latest,dagger/ci/tag-release --lint=false --test=false
when:
event:
- tag
instance:
- drone-publish.rancher.io
refs:
- refs/heads/main
- refs/heads/release
- refs/tags/*
- name: publish-main
image: *image
user: root
environment: *environment
volumes: *volumes
commands:
- go run ./dagger -c dagger/ci/defaults,dagger/ci/push --lint=false --test=false
when:
event:
- push
instance:
- drone-publish.rancher.io
branch:
- main
- name: upload-coverage
image: plugins/codecov
settings:
token:
from_secret: codecov_token
files:
- cover.out
when:
event:
- push
instance:
- drone-pr.rancher.io
- name: cleanup-dagger-engine
image: *image
user: root
commands:
- docker stop --time 60 dagger-engine
- docker logs dagger-engine
- docker rm dagger-engine
volumes: *volumes
# run even if pipeline fails
when:
status:
- failure
- success
instance:
- drone-publish.rancher.io
- drone-pr.rancher.io
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock
- name: docker-config
host:
path: /root/.docker