forked from sigp/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
81 lines (76 loc) · 2.39 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
library 'jenkins_lib@main'
pipeline {
agent any
options {
ansiColor('xterm')
}
environment {
// AWS_ECR_URL needs to be set in jenkin's config.
// AWS_ECR_URL could really be any docker registry. we just use ECR so that we don't have to manage it
REGISTRY="${AWS_ECR_URL}/lighthouse"
// branch that should get tagged with "latest_$arch" (stable, main, master, etc.)
LATEST_BRANCH="stable"
// non-buildkit builds are officially deprecated
// buildkit is much faster and handles caching much better than the default build process.
DOCKER_BUILDKIT=1
GIT_SHORT="${GIT_COMMIT.substring(0,8)}"
}
stages {
stage('build and push') {
parallel {
stage('build and push amd64 image') {
agent {
label 'amd64'
}
environment {
ARCH="amd64"
}
steps {
script {
myBuildAndPush.buildAndPush()
}
}
}
stage('build and push arm64 image') {
agent {
label 'arm64'
}
environment {
ARCH="arm64"
}
steps {
script {
myBuildAndPush.buildAndPush()
}
}
}
}
}
stage('push latest') {
parallel {
stage('maybe push latest_amd64 tag') {
agent any
environment {
ARCH="amd64"
}
steps {
script {
myPushLatest.maybePushLatest()
}
}
}
stage('maybe push latest_arm64 tag') {
agent any
environment {
ARCH="arm64"
}
steps {
script {
myPushLatest.maybePushLatest()
}
}
}
}
}
}
}