logos-messaging-nim/ci/Jenkinsfile.release
NagyZoltanPeter a7df0d9c56
chore: adjust artifact builds and uploads to contain logosdeliverynode app (#4059)
* feat(nix): add logosdeliverynode build target

Generalize the wakucanary-only binary path in nix/default.nix into an
app-target map so any app binary shares one build/install/rln-bundle
path, and expose a `logosdeliverynode` flake package (with gitVersion
for --version reporting).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(github): build logosdeliverynode in release/pre-release/windows workflows

- release-assets.yml: build logosdeliverynode (POSTGRES=1) so it ships in
  the waku-<arch>-<os>.tar.gz release asset.
- pre-release.yml: add logosdeliverynode to the make targets and to the
  nwaku nightly/RC tarball.
- windows-build.yml: build logosdeliverynode.exe and assert it exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(jenkins): build & push logosdeliverynode docker image to harbor

Jenkinsfile.release now builds a second image from the dedicated
logosdeliverynode Dockerfile stage and pushes it to
harbor.status.im/wakuorg/logosdelivery:<IMAGE_TAG> alongside the primary
image. Add a logosdeliverynode stage to the root Dockerfile so the image
entrypoint is /usr/bin/logosdeliverynode rather than the generic
/usr/bin/wakunode symlink. Bump the pipeline timeout to 40m to cover the
extra compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-28 11:20:05 +01:00

184 lines
6.1 KiB
Groovy

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.8.17'
pipeline {
agent {
docker {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/var/run/docker.sock:/var/run/docker.sock ' +
'--user jenkins'
}
}
options {
timestamps()
disableRestartFromStage()
timeout(time: 40, unit: 'MINUTES')
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '30',
))
}
parameters {
string(
name: 'MAKE_TARGET',
description: 'Makefile target to build. Optional Parameter.',
defaultValue: params.MAKE_TARGET ?: 'wakunode2',
)
string(
name: 'IMAGE_TAG',
description: 'Name of Docker tag to push. Optional Parameter.',
defaultValue: getDefaultImageTag()
)
string(
name: 'IMAGE_NAME',
description: 'Name of Docker image to push.',
defaultValue: params.IMAGE_NAME ?: 'harbor.status.im/wakuorg/nwaku',
)
string(
name: 'LOGOSDELIVERY_IMAGE_NAME',
description: 'Name of the logosdeliverynode Docker image to push.',
defaultValue: params.LOGOSDELIVERY_IMAGE_NAME ?: 'harbor.status.im/wakuorg/logosdelivery',
)
string(
name: 'DOCKER_CRED',
description: 'Name of Docker Registry credential.',
defaultValue: params.DOCKER_CRED ?: 'harbor-wakuorg-robot',
)
string(
name: 'DOCKER_REGISTRY_URL',
description: 'URL of the Docker Registry',
defaultValue: params.DOCKER_REGISTRY_URL ?: 'https://harbor.status.im'
)
string(
name: 'NIMFLAGS',
description: 'Flags for Nim compilation.',
defaultValue: params.NIMFLAGS ?: [
'--colors:off',
'-d:disableMarchNative',
'-d:chronicles_colors:none',
'-d:insecure',
].join(' ')
)
choice(
name: "LOWEST_LOG_LEVEL_ALLOWED",
choices: ['TRACE', 'DEGUG', 'INFO', 'NOTICE', 'WARN', 'ERROR', 'FATAL'],
description: "Defines the log level, which will be available at runtime (Chronicles log level)",
)
booleanParam(
name: 'DEBUG',
description: 'Enable debug features',
defaultValue: false
)
booleanParam(
name: 'HEAPTRACK',
description: 'Enable heaptrack build',
defaultValue: false
)
}
stages {
stage('Build') {
steps { script {
if (params.HEAPTRACK) {
echo 'Building with heaptrack support'
image = docker.build(
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: env.GIT_COMMIT.take(8)}",
"--label=build='${env.BUILD_URL}' " +
"--label=commit='${git.commit()}' " +
"--label=version='${git.describe('--tags')}' " +
"--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " +
"--build-arg=NIMFLAGS='${params.NIMFLAGS} -d:heaptracker ' " +
"--build-arg=POSTGRES='1' " +
"--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " +
"--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " +
"--build-arg=NIM_COMMIT='NIM_COMMIT=heaptrack_support_v2.0.12' " +
"--target='debug-with-heaptrack' ."
)
} else {
image = docker.build(
"${params.IMAGE_NAME}:${params.IMAGE_TAG ?: env.GIT_COMMIT.take(8)}",
"--label=build='${env.BUILD_URL}' " +
"--label=commit='${git.commit()}' " +
"--label=version='${git.describe('--tags')}' " +
"--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " +
"--build-arg=NIMFLAGS='${params.NIMFLAGS}' " +
"--build-arg=POSTGRES='1' " +
"--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " +
"--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " +
"--target='prod' ."
)
}
/* logosdeliverynode image is always built, regardless of the primary
* target / heaptrack selection above. It uses the dedicated
* 'logosdeliverynode' stage so its entrypoint is /usr/bin/logosdeliverynode. */
echo 'Building logosdeliverynode image'
logosDeliveryImage = docker.build(
"${params.LOGOSDELIVERY_IMAGE_NAME}:${params.IMAGE_TAG ?: env.GIT_COMMIT.take(8)}",
"--label=build='${env.BUILD_URL}' " +
"--label=commit='${git.commit()}' " +
"--label=version='${git.describe('--tags')}' " +
"--build-arg=MAKE_TARGET='logosdeliverynode' " +
"--build-arg=NIMFLAGS='${params.NIMFLAGS}' " +
"--build-arg=POSTGRES='1' " +
"--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " +
"--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " +
"--target='logosdeliverynode' ."
)
} }
}
stage('Check') {
steps { script {
image.inside('--entrypoint=""') { c ->
sh '/usr/bin/wakunode --version'
}
logosDeliveryImage.inside('--entrypoint=""') { c ->
sh '/usr/bin/logosdeliverynode --version'
}
} }
}
stage('Push') {
when { expression { params.IMAGE_TAG != '' } }
steps { script {
withDockerRegistry([
credentialsId: params.DOCKER_CRED, url: params.DOCKER_REGISTRY_URL
]) {
image.push()
logosDeliveryImage.push()
/* If Git ref is a tag push it as Docker tag too. */
if (params.GIT_REF ==~ /v\d+\.\d+\.\d+.*/) {
image.push(params.GIT_REF)
image.push('latest-release')
logosDeliveryImage.push(params.GIT_REF)
logosDeliveryImage.push('latest-release')
}
}
} }
}
} // stages
post {
success { script {
discord.send(
header: '**Nim-Waku deployment successful!**',
cred: 'discord-waku-deployments-webhook',
descPrefix: "Image: [`${IMAGE_NAME}:${IMAGE_TAG}`](https://hub.docker.com/r/${IMAGE_NAME}/tags?name=${IMAGE_TAG})"
)
} }
always { sh 'docker image prune -f' }
} // post
} // pipeline
def getDefaultImageTag() {
switch (env.JOB_BASE_NAME) {
case 'docker-latest': return 'latest'
case 'docker-release': return 'stable'
default: return env.JOB_BASE_NAME
}
}