ci: add docker image build of cms

Referenced issue:
* https://github.com/status-im/infra-sites/issues/135

Signed-off-by: markoburcul <marko@status.im>
This commit is contained in:
2026-07-01 10:34:38 +02:00
parent 2be0b14585
commit 3b29cd5c3a
Vendored
+50 -2
View File
@@ -8,7 +8,9 @@ pipeline {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/nix:/nix ' +
'--volume=/etc/nix:/etc/nix '
'--volume=/etc/nix:/etc/nix ' +
'--volume=/var/run/docker.sock:/var/run/docker.sock ' +
'--user jenkins'
}
}
@@ -31,6 +33,26 @@ pipeline {
defaultValue: '2ec82f0e-5f3c-45d2-ba38-223ceb5eee42',
description: 'Public hCaptcha site key for the apps/web hCaptcha widget.',
)
string(
name: 'DOCKER_CRED',
description: 'Name of Docker Registry credential.',
defaultValue: params.DOCKER_CRED ?: 'harbor-logos-web-robot',
)
string(
name: 'DOCKER_REGISTRY_URL',
description: 'URL of the Docker Registry',
defaultValue: params.DOCKER_REGISTRY_URL ?: 'https://harbor.status.im',
)
string(
name: 'IMAGE_TAG',
description: 'Image tag',
defaultValue: params.IMAGE_TAG ?: deployBranch(),
)
string(
name: 'IMAGE_NAME',
description: 'Name of the Docker image',
defaultValue: 'logos-web/logos-cms',
)
}
stages {
@@ -57,7 +79,7 @@ pipeline {
}
}
stage('Publish') {
stage('Publish web app') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
@@ -72,6 +94,31 @@ pipeline {
}
}
}
stage('Build CMS docker image') {
steps {
script {
image = docker.build(
"${params.IMAGE_NAME}:${params.IMAGE_TAG}",
"--build-arg NEXT_PUBLIC_SERVER_URL=https://${cmsDomain()} " +
"--build-arg NEXT_PUBLIC_WEB_URL=https://${deployDomain()} " +
"-f ./apps/cms/Dockerfile ."
)
}
}
}
stage('Push CMS docker image'){
steps {
script {
withDockerRegistry([
credentialsId: params.DOCKER_CRED, url: params.DOCKER_REGISTRY_URL
]) {
image.push()
}
}
}
}
}
post {
cleanup { cleanWs() }
@@ -82,3 +129,4 @@ def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'logos.co' : 'dev.logos.co' }
def apiMode() { isMasterBranch() ? 'production' : 'staging' }
def civiCrmUrl() { isMasterBranch() ? 'https://logos-web-civi.vercel.app' : 'https://logos-web-civi-git-develop-status-im-web.vercel.app/' }
def cmsDomain() { isMasterBranch() ? 'cms.logos.co' : 'dev-cms.logos.co' }