2024-09-11 00:58:57 +09:00
|
|
|
pipeline {
|
|
|
|
agent { label 'linux' }
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'IMAGE_TAG',
|
|
|
|
defaultValue: params.IMAGE_TAG ?: '',
|
|
|
|
description: 'Optional Docker image tag to push.'
|
|
|
|
)
|
2024-10-03 07:30:15 +05:30
|
|
|
string(
|
|
|
|
name: 'DOCKER_REGISTRY',
|
|
|
|
description: 'Docker registry ',
|
|
|
|
defaultValue: params.DOCKER_REGISTRY ?: 'harbor.status.im',
|
|
|
|
)
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2024-10-03 07:30:15 +05:30
|
|
|
IMAGE_NAME = 'acid-info-private/logos-ordinals-dashboard'
|
2024-09-11 00:58:57 +09:00
|
|
|
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}"
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-10-02 23:03:18 +05:30
|
|
|
script {
|
|
|
|
image = docker.build(
|
2024-10-03 07:30:15 +05:30
|
|
|
"${DOCKER_REGISTRY}/${IMAGE_NAME}:${GIT_COMMIT.take(8)}",
|
2024-10-02 23:03:18 +05:30
|
|
|
)
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Push') {
|
2024-10-02 23:03:18 +05:30
|
|
|
steps {
|
|
|
|
script {
|
2024-10-03 07:30:15 +05:30
|
|
|
withDockerRegistry([credentialsId: 'harbor-acid-info-private-robot', url: 'https://${DOCKER_REGISTRY}']) {
|
2024-10-02 23:03:18 +05:30
|
|
|
image.push()
|
|
|
|
}
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
2024-10-02 23:03:18 +05:30
|
|
|
}
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
stage('Deploy') {
|
|
|
|
when { expression { params.IMAGE_TAG != '' } }
|
2024-10-02 23:03:18 +05:30
|
|
|
steps {
|
|
|
|
script {
|
2024-10-03 07:30:15 +05:30
|
|
|
withDockerRegistry([credentialsId: 'harbor-acid-info-private-robot', url: 'https://${DOCKER_REGISTRY}']) {
|
2024-10-02 23:03:18 +05:30
|
|
|
image.push(params.IMAGE_TAG)
|
|
|
|
}
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
2024-10-02 23:03:18 +05:30
|
|
|
}
|
2024-09-11 00:58:57 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|