web3-proxy/Jenkinsfile

85 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-01-27 19:45:08 +03:00
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
'''
}
2023-01-27 19:45:08 +03:00
pipeline {
agent any
2023-01-31 01:59:34 +03:00
options {
ansiColor('xterm')
}
2023-01-27 19:45:08 +03:00
environment {
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 {
stage('build and push') {
2023-01-27 19:45:08 +03:00
parallel {
2023-02-03 23:06:35 +03:00
stage('Build and push amd64_epyc2 image') {
agent {
2023-02-03 23:06:35 +03:00
label 'amd64_epyc2'
2023-01-27 19:45:08 +03:00
}
steps {
script {
2023-02-03 23:06:35 +03:00
DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64_epyc2"
restoreMTime()
try {
amd_image = docker.build("$DOCKER_GIT_TAG_AMD")
} catch (e) {
2023-02-03 23:06:35 +03:00
def err = "amd64_epyc2 build failed: ${e}"
error(err)
}
2023-01-27 19:45:08 +03:00
amd_image.push()
2023-02-03 23:06:35 +03:00
amd_image.push('latest_amd64_epyc2')
2023-01-27 19:45:08 +03:00
}
}
}
2023-02-03 23:06:35 +03:00
stage('Build and push arm64_graviton2 image') {
agent {
2023-02-03 23:06:35 +03:00
label 'arm64_graviton2'
}
2023-01-27 19:45:08 +03:00
steps {
script {
2023-02-03 23:06:35 +03:00
DOCKER_GIT_TAG_ARM="$DOCKER_GIT_TAG" + "_arm64_graviton2"
restoreMTime()
try {
arm_image = docker.build("$DOCKER_GIT_TAG_ARM")
} catch (e) {
2023-02-03 23:06:35 +03:00
def err = "arm64_graviton2 build failed: ${e}"
error(err)
}
2023-01-27 19:45:08 +03:00
arm_image.push()
2023-02-03 23:06:35 +03:00
arm_image.push('latest_arm64_graviton2')
2023-01-27 19:45:08 +03:00
}
}
}
2023-02-03 23:06:35 +03:00
stage('Build and push intel_xeon3 image') {
agent {
2023-02-03 23:06:35 +03:00
label 'intel_xeon3'
}
2023-01-27 19:45:08 +03:00
steps {
script {
2023-02-03 23:06:35 +03:00
DOCKER_GIT_TAG_INTEL="$DOCKER_GIT_TAG" + "_intel_xeon3"
restoreMTime()
try {
intel_image = docker.build("$DOCKER_GIT_TAG_INTEL")
} catch (e) {
2023-02-03 23:06:35 +03:00
def err = "intel_xeon3 build failed: ${e}"
error(err)
}
2023-01-27 19:45:08 +03:00
intel_image.push()
2023-02-03 23:06:35 +03:00
intel_image.push('latest_intel_xeon3')
2023-01-27 19:45:08 +03:00
}
}
}
}
}
2023-01-27 19:45:08 +03:00
}
2023-01-28 12:48:58 +03:00
}