2022-01-24 10:53:45 +00:00
|
|
|
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'
|
2022-02-02 00:35:28 +00:00
|
|
|
PUPPETEER_SKIP_DOWNLOAD = 'true'
|
2022-01-24 10:53:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2022-02-02 00:35:28 +00:00
|
|
|
stage('Deps') {
|
2022-01-24 10:53:45 +00:00
|
|
|
steps {
|
2022-02-02 00:35:28 +00:00
|
|
|
sh 'npm install'
|
2022-01-24 10:53:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2022-02-02 00:35:28 +00:00
|
|
|
sh 'npm run build'
|
|
|
|
sh 'npm run doc'
|
2022-01-24 10:53:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-02 00:35:28 +00:00
|
|
|
stage('Examples') {
|
|
|
|
parallel {
|
|
|
|
stage('web-chat') { steps { script { buildExample() } } }
|
|
|
|
stage('eth-pm') { steps { script { buildExample() } } }
|
|
|
|
stage('eth-pm-wallet-encryption') { steps { script { buildExample() } } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish') {
|
|
|
|
when { expression { GIT_BRANCH.endsWith('build-examples') } }
|
2022-01-24 10:53:45 +00:00
|
|
|
steps { script {
|
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
2022-02-02 00:35:28 +00:00
|
|
|
sh 'npm run deploy'
|
2022-01-24 10:53:45 +00:00
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
2022-02-02 00:35:28 +00:00
|
|
|
post {
|
|
|
|
always { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildExample(example=STAGE_NAME) {
|
|
|
|
def dest = "${WORKSPACE}/build/docs/examples/${example}"
|
|
|
|
dir("examples/${example}") {
|
|
|
|
sh 'npm install'
|
|
|
|
sh 'npm run build'
|
|
|
|
sh "mkdir -p ${dest}"
|
|
|
|
sh "cp -r build/. ${dest}"
|
|
|
|
}
|
2022-01-24 10:53:45 +00:00
|
|
|
}
|