2023-03-16 13:21:27 +00:00
|
|
|
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'
|
2023-03-21 17:53:09 +00:00
|
|
|
PROD_SITE = 'waku.org'
|
|
|
|
DEV_SITE = 'dev.waku.org'
|
|
|
|
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
|
|
|
|
SCP_OPTS = 'StrictHostKeyChecking=no'
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Install') {
|
|
|
|
steps {
|
2023-06-01 20:48:43 +00:00
|
|
|
sh "yarn install"
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2023-11-17 14:37:34 +00:00
|
|
|
/* Issues from waku-org/bounties are fetched. */
|
|
|
|
withCredentials([
|
|
|
|
string(
|
|
|
|
credentialsId: 'waku-org-bounties-access-gh-token',
|
|
|
|
variable: 'GITHUB_ACCESS_TOKEN'
|
|
|
|
),
|
|
|
|
]) {
|
|
|
|
sh 'yarn build'
|
|
|
|
}
|
2023-06-01 20:48:43 +00:00
|
|
|
sh "echo ${env.PROD_SITE} > build/CNAME"
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish Prod') {
|
|
|
|
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
|
|
|
|
steps {
|
2023-06-01 20:48:43 +00:00
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
|
|
|
sh "ghp-import -p build"
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish Devel') {
|
|
|
|
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
|
|
|
|
steps {
|
2023-06-01 20:48:43 +00:00
|
|
|
sshagent(credentials: ['jenkins-ssh']) {
|
|
|
|
sh """
|
|
|
|
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete build/. \
|
|
|
|
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
|
|
|
|
"""
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|