2023-06-26 01:37:23 +03:00
|
|
|
@Library('jenkins_lib@main') _
|
2023-01-27 19:45:08 +03:00
|
|
|
|
|
|
|
pipeline {
|
2023-06-27 19:27:56 +03:00
|
|
|
agent {
|
|
|
|
// not strictly required, but we only build graviton2 right now so this keeps the jenkins-agent count down
|
|
|
|
label 'arm64_graviton2'
|
|
|
|
}
|
2023-02-09 23:00:41 +03:00
|
|
|
options {
|
|
|
|
ansiColor('xterm')
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
environment {
|
2023-07-28 21:34:39 +03:00
|
|
|
// TODO: can we just use jenkin's PROJECT_NAME? I think that might cause problems with things in the provisioning repo
|
|
|
|
REPO_NAME="web3-proxy"
|
|
|
|
|
2023-02-05 11:13:14 +03:00
|
|
|
// 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
|
2023-07-28 21:34:39 +03:00
|
|
|
REGISTRY="${AWS_ECR_URL}/${REPO_NAME}"
|
2023-02-05 11:13:14 +03:00
|
|
|
|
|
|
|
// branch that should get tagged with "latest_$arch" (stable, main, master, etc.)
|
2023-02-09 23:19:10 +03:00
|
|
|
LATEST_BRANCH="main"
|
2023-02-05 11:13:14 +03:00
|
|
|
|
|
|
|
// non-buildkit builds are officially deprecated
|
|
|
|
// buildkit is much faster and handles caching much better than the default build process.
|
2023-01-27 19:45:08 +03:00
|
|
|
DOCKER_BUILDKIT=1
|
2023-02-05 11:13:14 +03:00
|
|
|
|
|
|
|
GIT_SHORT="${GIT_COMMIT.substring(0,8)}"
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
|
|
|
stages {
|
2023-01-30 00:42:53 +03:00
|
|
|
stage('build and push') {
|
2023-01-27 19:45:08 +03:00
|
|
|
parallel {
|
2023-06-26 01:49:50 +03:00
|
|
|
// stage('build and push amd64_epyc2 image') {
|
|
|
|
// agent {
|
|
|
|
// label 'amd64_epyc2'
|
|
|
|
// }
|
|
|
|
// environment {
|
|
|
|
// ARCH="amd64_epyc2"
|
|
|
|
// }
|
|
|
|
// steps {
|
|
|
|
// script {
|
|
|
|
// myBuildandPush.buildAndPush()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// stage('build and push amd64_epyc3 image') {
|
|
|
|
// agent {
|
|
|
|
// label 'amd64_epyc3'
|
|
|
|
// }
|
|
|
|
// environment {
|
|
|
|
// ARCH="amd64_epyc3"
|
|
|
|
// }
|
|
|
|
// steps {
|
|
|
|
// script {
|
|
|
|
// myBuildandPush.buildAndPush()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2023-02-03 23:06:35 +03:00
|
|
|
stage('Build and push arm64_graviton2 image') {
|
2023-01-30 00:42:53 +03:00
|
|
|
agent {
|
2023-02-03 23:06:35 +03:00
|
|
|
label 'arm64_graviton2'
|
2023-01-30 00:42:53 +03:00
|
|
|
}
|
2023-02-05 11:13:14 +03:00
|
|
|
environment {
|
|
|
|
ARCH="arm64_graviton2"
|
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
steps {
|
|
|
|
script {
|
2023-06-26 01:49:50 +03:00
|
|
|
myBuildandPush.buildAndPush()
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-26 01:49:50 +03:00
|
|
|
// stage('Build and push intel_xeon3 image') {
|
|
|
|
// agent {
|
|
|
|
// label 'intel_xeon3'
|
|
|
|
// }
|
|
|
|
// environment {
|
|
|
|
// ARCH="intel_xeon3"
|
|
|
|
// }
|
|
|
|
// steps {
|
|
|
|
// script {
|
|
|
|
// myBuildandPush.buildAndPush()
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('push latest') {
|
|
|
|
parallel {
|
|
|
|
stage('maybe push latest_arm64_graviton2 tag') {
|
|
|
|
agent any
|
2023-02-05 11:13:14 +03:00
|
|
|
environment {
|
2023-06-26 01:49:50 +03:00
|
|
|
ARCH="arm64_graviton2"
|
2023-02-05 11:13:14 +03:00
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
steps {
|
|
|
|
script {
|
2023-06-26 01:49:50 +03:00
|
|
|
myPushLatest.maybePushLatest()
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 00:42:53 +03:00
|
|
|
}
|
2023-01-27 19:45:08 +03:00
|
|
|
}
|
2023-01-28 12:48:58 +03:00
|
|
|
}
|