js-waku/ci/Jenkinsfile
markoburcul e2c9364053
ci: move it to a container
Add nix flake and use it in the pipeline for reliability and reproducability.

Referenced issue:
* https://github.com/status-im/infra-ci/issues/188
2025-10-23 12:53:04 +02:00

69 lines
1.3 KiB
Groovy

pipeline {
agent {
docker {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/nix:/nix ' +
'--volume=/etc/nix:/etc/nix ' +
'--user jenkins'
}
}
options {
disableConcurrentBuilds()
disableRestartFromStage()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_AUTHOR_NAME = 'status-im-auto'
GIT_AUTHOR_EMAIL = 'auto@status.im'
PUPPETEER_SKIP_DOWNLOAD = 'true'
NO_COLOR = 'true'
}
stages {
stage('Deps') {
steps {
script {
nix.develop('npm install', pure: true)
}
}
}
stage('Packages') {
steps {
script {
nix.develop('npm run build', pure: true)
}
}
}
stage('Build') {
steps {
script {
nix.develop('npm run doc', pure: true)
}
}
}
stage('Publish') {
when { expression { GIT_BRANCH.endsWith('master') } }
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop('npm run deploy', pure: true)
}
}
}
}
}
post {
always { cleanWs() }
}
}