2022-09-06 17:55:29 +00:00
|
|
|
pipeline {
|
2022-09-23 15:19:51 +00:00
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
label 'linux'
|
|
|
|
dir 'ci'
|
|
|
|
}
|
|
|
|
}
|
2022-09-06 17:55:29 +00:00
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
SITE_DOMAIN = 'examples.waku.org'
|
|
|
|
GIT_AUTHOR_NAME = 'status-im-auto'
|
|
|
|
GIT_AUTHOR_EMAIL = 'auto@status.im'
|
2022-09-23 15:19:51 +00:00
|
|
|
GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=no'
|
2022-09-06 17:55:29 +00:00
|
|
|
PUPPETEER_SKIP_DOWNLOAD = 'true'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Pre') {
|
|
|
|
steps {
|
2022-12-23 22:11:39 +00:00
|
|
|
sh 'npm install --silent'
|
2022-09-06 17:55:29 +00:00
|
|
|
/* TODO: Build the main page. */
|
|
|
|
sh 'mkdir -p build/docs'
|
2023-05-05 01:39:29 +00:00
|
|
|
sh 'cp index.html build/docs/'
|
2022-09-06 17:55:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Examples') {
|
|
|
|
parallel {
|
|
|
|
stage('eth-pm') { steps { script { buildExample() } } }
|
|
|
|
stage('relay-angular-chat') { steps { script { buildExample() } } }
|
|
|
|
stage('relay-reactjs-chat') { steps { script { buildExample() } } }
|
|
|
|
stage('store-reactjs-chat') { steps { script { buildExample() } } }
|
|
|
|
stage('web-chat') { steps { script { buildExample() } } }
|
2023-01-26 17:25:02 +00:00
|
|
|
stage('noise-js') { steps { script { buildExample() } } }
|
2023-01-27 22:09:13 +00:00
|
|
|
stage('noise-rtc') { steps { script { buildExample() } } }
|
2023-10-02 23:03:48 +00:00
|
|
|
stage('relay-direct-rtc') { steps { script { buildExample() } } }
|
2022-09-06 17:55:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('HTML Examples') {
|
|
|
|
parallel {
|
|
|
|
stage('relay-js') { steps { script { copyExample() } } }
|
|
|
|
stage('store-js') { steps { script { copyExample() } } }
|
2022-09-13 12:46:34 +00:00
|
|
|
stage('light-js') { steps { script { copyExample() } } }
|
2022-12-21 21:30:10 +00:00
|
|
|
stage('light-chat') { steps { script { copyExample() } } }
|
2022-09-06 17:55:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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}"
|
2022-12-21 22:30:02 +00:00
|
|
|
dir("examples/${example}") {
|
2022-12-23 22:11:39 +00:00
|
|
|
sh 'npm install --silent'
|
|
|
|
sh 'npm run build'
|
2022-09-06 17:55:29 +00:00
|
|
|
sh "mkdir -p ${dest}"
|
|
|
|
sh "cp -r build/. ${dest}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def copyExample(example=STAGE_NAME) {
|
2023-01-11 21:21:56 +00:00
|
|
|
def source = "examples/${example}"
|
|
|
|
def dest = "build/docs/${example}"
|
|
|
|
sh "mkdir -p ${dest}"
|
2023-01-17 10:37:45 +00:00
|
|
|
sh "cp -r ${source}/. ${dest}"
|
2022-09-06 17:55:29 +00:00
|
|
|
}
|