forked from maticnetwork/heimdall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
63 lines (61 loc) · 2.05 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
def amd_image
def arm_image
def intel_image
def restoreMTime() {
sh '''
git restore-mtime
touch -t $(git show -s --date=format:'%Y%m%d%H%M.%S' --format=%cd HEAD) .git
'''
}
pipeline {
agent any
environment {
DOCKER_GIT_TAG="$AWS_ECR_URL/heimdall:${GIT_COMMIT.substring(0,8)}"
DOCKER_BUILDKIT=1
}
stages {
stage('build and push') {
parallel {
stage('Build and push amd64 image') {
agent {
label 'amd64_epyc2'
}
steps {
script {
DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64"
restoreMTime()
try {
amd_image = docker.build("$DOCKER_GIT_TAG_AMD")
} catch (e) {
def err = "amd64 build failed: ${e}"
error(err)
}
amd_image.push()
amd_image.push('latest')
amd_image.push('latest_amd64')
}
}
}
stage('Build and push arm64 image') {
agent {
label 'arm64_graviton2'
}
steps {
script {
DOCKER_GIT_TAG_ARM="$DOCKER_GIT_TAG" + "_arm64"
restoreMTime()
try {
arm_image = docker.build("$DOCKER_GIT_TAG_ARM")
} catch (e) {
def err = "arm64 build failed: ${e}"
error(err)
}
arm_image.push()
arm_image.push('latest_arm64')
}
}
}
}
}
}
}