2023-01-27 19:45:08 +03:00
|
|
|
def amd_image
|
|
|
|
def arm_image
|
|
|
|
def intel_image
|
2023-01-28 12:08:56 +03:00
|
|
|
def restoreMTime() {
|
|
|
|
sh '''
|
|
|
|
git restore-mtime
|
|
|
|
touch -t $(git show -s --date=format:'%Y%m%d%H%M.%S' --format=%cd HEAD) .git
|
|
|
|
'''
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
environment {
|
2023-01-29 11:06:02 +03:00
|
|
|
DOCKER_GIT_TAG="$AWS_ECR_URL/web3-proxy:${GIT_COMMIT.substring(0,8)}"
|
2023-01-27 19:45:08 +03:00
|
|
|
DOCKER_BUILDKIT=1
|
|
|
|
}
|
|
|
|
stages {
|
2023-01-30 00:42:53 +03:00
|
|
|
stage('build and push') {
|
2023-01-27 19:45:08 +03:00
|
|
|
parallel {
|
2023-01-30 00:42:53 +03:00
|
|
|
stage('Build and push amd64 image') {
|
|
|
|
agent {
|
|
|
|
label 'amd64_jenkins_agent'
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
|
|
|
steps {
|
|
|
|
script {
|
2023-01-30 00:42:53 +03:00
|
|
|
DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64"
|
2023-01-28 12:08:56 +03:00
|
|
|
restoreMTime()
|
2023-01-30 00:42:53 +03:00
|
|
|
try {
|
|
|
|
amd_image = docker.build("$DOCKER_GIT_TAG_AMD")
|
|
|
|
} catch (e) {
|
|
|
|
def err = "amd64 build failed: ${e}"
|
|
|
|
error(err)
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
amd_image.push()
|
|
|
|
amd_image.push('latest_amd3')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 00:42:53 +03:00
|
|
|
stage('Build and push arm64 image') {
|
|
|
|
agent {
|
|
|
|
label 'arm64_jenkins_agent'
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
steps {
|
|
|
|
script {
|
2023-01-30 00:42:53 +03:00
|
|
|
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)
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
arm_image.push()
|
|
|
|
arm_image.push('latest_graviton2')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 00:42:53 +03:00
|
|
|
stage('Build and push intel image') {
|
|
|
|
agent {
|
|
|
|
label 'intel_jenkins_agent'
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
steps {
|
|
|
|
script {
|
2023-01-30 00:42:53 +03:00
|
|
|
DOCKER_GIT_TAG_INTEL="$DOCKER_GIT_TAG" + "_intel_sky_lake"
|
|
|
|
restoreMTime()
|
|
|
|
try {
|
|
|
|
intel_image = docker.build("$DOCKER_GIT_TAG_INTEL")
|
|
|
|
} catch (e) {
|
|
|
|
def err = "intel_sky_lake build failed: ${e}"
|
|
|
|
error(err)
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
intel_image.push()
|
|
|
|
intel_image.push('latest')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 00:42:53 +03:00
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
2023-01-28 12:48:58 +03:00
|
|
|
}
|