pipeline { agent { dockerfile { label 'linux' dir 'ci' args '-v /home/jenkins/.ssh/known_hosts:/home/jenkins/.ssh/known_hosts:ro' } } options { disableConcurrentBuilds() /* manage how many builds we keep */ buildDiscarder(logRotator( numToKeepStr: '20', daysToKeepStr: '30', )) } environment { SITE_DOMAIN = 'lab.waku.org' GIT_AUTHOR_NAME = 'status-im-auto' GIT_AUTHOR_EMAIL = 'auto@status.im' PUPPETEER_SKIP_DOWNLOAD = 'true' } stages { stage('Pre') { steps { sh 'npm install --silent' /* TODO: Build the main page. */ sh 'mkdir -p build/docs' sh 'cp index.html build/docs/' } } stage('Examples') { parallel { stage('experimental/web-chat') { steps { script { buildExample() } } } stage('experimental/noise-js') { steps { script { buildExample() } } } stage('experimental/noise-rtc') { steps { script { buildExample() } } } stage('experimental/relay-direct-rtc') { steps { script { buildExample() } } } stage('experimental/rln-js') { steps { script { buildExample() } } } stage('experimental/rln-identity') { steps { script { buildExample() } } } stage('dogfooding') { steps { script { buildExample() } } } stage('message-monitor') { steps { script { buildExample() } } } stage('flush-notes') { steps { script { buildNextJSExample() } } } } } stage('HTML Examples') { parallel { stage('experimental/relay-js') { steps { script { copyExample() } } } stage('experimental/light-js') { steps { script { copyExample() } } } } } stage('Publish') { steps { script { sh "echo ${SITE_DOMAIN} > build/docs/CNAME" sshagent(credentials: ['status-im-auto-ssh']) { sh 'node ci/deploy.js' } } } } } post { always { cleanWs() } } } def buildExample(example=STAGE_NAME) { def dest = "${WORKSPACE}/build/docs/${example}" dir("examples/${example}") { sh 'npm install --silent' sh 'npm run build' sh "mkdir -p ${dest}" sh "cp -r build/. ${dest}" } } def buildNextJSExample(example=STAGE_NAME) { def dest = "${WORKSPACE}/build/docs/${example}" dir("examples/${example}") { sh 'npm install --silent' sh 'npm run build' sh "mkdir -p ${dest}" sh "cp -r out/. ${dest}" } } def copyExample(example=STAGE_NAME) { def source = "examples/${example}" def dest = "build/docs/${example}" sh "mkdir -p ${dest}" sh "cp -r ${source}/. ${dest}" }