js-waku/ci/Jenkinsfile.gh-pages

80 lines
1.8 KiB
Plaintext
Raw Normal View History

pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* 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'
}
stages {
stage('Deps') {
steps {
sh 'npm ci'
}
}
stage('Build') {
steps {
sh 'npm run build'
sh 'npm run doc'
}
}
stage('Examples') {
parallel {
stage('eth-pm') { steps { script { buildExample() } } }
stage('eth-pm-wallet-encryption') { steps { script { buildExample() } } }
2022-05-02 06:25:49 +00:00
stage('relay-reactjs-chat') { steps { script { buildExample() } } }
stage('store-reactjs-chat') { steps { script { buildExample() } } }
stage('web-chat') { steps { script { buildExample() } } }
}
}
2022-05-13 06:06:16 +00:00
stage('HTML Examples') {
parallel {
stage('relay-js') { steps { script { copyExample() } } }
stage('store-js') { steps { script { copyExample() } } }
}
}
stage('Publish') {
when { expression { GIT_BRANCH.endsWith('master') } }
steps { script {
sshagent(credentials: ['status-im-auto-ssh']) {
sh 'npm run deploy'
}
} }
}
}
post {
always { cleanWs() }
}
}
def buildExample(example=STAGE_NAME) {
def dest = "${WORKSPACE}/build/docs/examples/${example}"
dir("examples/${example}") {
sh 'npm ci'
sh 'npm run build'
sh "mkdir -p ${dest}"
sh "cp -r build/. ${dest}"
}
}
2022-05-13 06:06:16 +00:00
def copyExample(example=STAGE_NAME) {
def dest = "${WORKSPACE}/build/docs/examples/${example}"
dir("examples/${example}") {
sh "cp index.html ${dest}"
}
}