-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
64 lines (61 loc) · 1.85 KB
/
Jenkinsfile
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
pipeline {
agent {
kubernetes {
defaultContainer 'earthly'
inheritFrom 'default'
yaml '''
spec:
containers:
- name: tailscale
image: tailscale/tailscale
securityContext:
privileged: true
env:
- name: TS_AUTHKEY
valueFrom:
secretKeyRef:
name: tailscale-auth-key
key: TS_AUTHKEY
- name: TS_ACCEPT_DNS
value: true
- name: TS_KUBE_SECRET
value:
- name: TS_USERSPACE
value: false
- name: earthly
image: earthly/earthly
env:
- name: NO_BUILDKIT
value: 1
- name: FORCE_COLOR
value: 1
command: ["sleep"]
args: ["1h"]
'''
}
}
options {
ansiColor('xterm')
}
environment {
EARTHLY_TOKEN = credentials('EARTHLY_TOKEN')
}
stages {
stage('Build') {
steps {
sh 'earthly --sat=lamport --org=sjerred --ci +ci --version=1.0.$BUILD_NUMBER-0 --git_sha=$GIT_COMMIT'
}
}
stage('Publish') {
when {
expression {
return env.BRANCH_NAME == 'main'
}
}
steps {
// TODO: can we notify ArgoCD to sync?
sh 'earthly --sat=lamport --org=sjerred --ci --push +ci --version=1.0.$BUILD_NUMBER-0 --git_sha=$GIT_COMMIT'
}
}
}
}