-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.drone.jsonnet
84 lines (83 loc) · 1.98 KB
/
.drone.jsonnet
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
[
{
kind: 'pipeline',
type: 'kubernetes',
name: 'next',
clone: {
depth: 1,
},
trigger: {
branch: {
exclude: ['release-please--branches--main--components--airbroke'],
},
event: {
include: ['push'],
},
},
steps: [
{
name: 'tag',
image: 'alpine/git',
commands: [
"export CUSTOM_BRANCH_NAME=$(basename \"${DRONE_SOURCE_BRANCH}\" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')",
'echo -n "$CUSTOM_BRANCH_NAME-$SHORT_SHA-$(date +%s)" > .tags',
],
environment: {
SHORT_SHA: '${DRONE_COMMIT_SHA:0:8}',
},
},
{
name: 'build-and-push',
image: 'thegeeklab/drone-docker-buildx',
privileged: true,
depends_on: ['tag'],
settings: {
debug: true,
purge: true,
no_cache: true,
platforms: ['linux/amd64'],
repo: 'ghcr.io/icoretech/airbroke',
registry: 'ghcr.io/icoretech',
username: {
from_secret: 'github_packages_username',
},
password: {
from_secret: 'github_packages_pat',
},
build_args: [
'DEBUG_TOOLS=true',
],
},
when: {
branch: ['main'],
},
},
{
name: 'build-no-push',
image: 'thegeeklab/drone-docker-buildx',
privileged: true,
depends_on: ['tag'],
settings: {
dry_run: true,
debug: true,
purge: true,
no_cache: true,
platforms: ['linux/amd64'],
repo: 'ghcr.io/icoretech/airbroke',
registry: 'ghcr.io/icoretech',
username: {
from_secret: 'github_packages_username',
},
password: {
from_secret: 'github_packages_pat',
},
},
when: {
branch: {
exclude: ['main'],
},
},
},
],
},
]