docs.waku.org/Jenkinsfile
Siddarth Kumar 87eaaea091
ci: add nix flake and use in CI
Using system tooling can lead to weird behavior of available Node
versions, for example this IPv6 resolution error:
```
[3/5] Fetching packages...
error Error: connect EHOSTUNREACH 2606:4700::6810:1922:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
```
2025-07-11 13:38:53 +05:30

59 lines
1.2 KiB
Groovy

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.24'
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
}
stages {
stage('Install') {
steps {
nix.develop('yarn install')
}
}
stage('Build') {
steps { script {
nix.develop('yarn build')
jenkins.genBuildMetaJSON('build/build.json')
} }
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p build
""", pure: false)
}
}
}
}
}
post {
cleanup { cleanWs() }
}
}
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'docs.waku.org' : 'dev-docs.waku.org' }