2021-09-29 11:35:01 +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'
|
|
|
|
/* dev page settings */
|
2022-11-08 18:13:04 +00:00
|
|
|
DEV_SITE = 'dev-js.waku.guide'
|
2021-09-29 11:35:01 +00:00
|
|
|
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
|
|
|
|
SCP_OPTS = 'StrictHostKeyChecking=no'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2021-12-09 14:27:58 +00:00
|
|
|
sh "hugo ${env.GIT_BRANCH ==~ /.*master/ ? '' : "-b https://${DEV_SITE}"}"
|
2021-09-29 11:35:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish Prod') {
|
|
|
|
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
|
|
|
|
steps {
|
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
2021-12-09 14:27:58 +00:00
|
|
|
sh "ghp-import -p public"
|
2021-09-29 11:35:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish Devel') {
|
|
|
|
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
|
|
|
|
steps {
|
|
|
|
sshagent(credentials: ['jenkins-ssh']) {
|
|
|
|
sh """
|
2021-12-09 14:27:58 +00:00
|
|
|
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete public/. \
|
2021-09-29 11:35:01 +00:00
|
|
|
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|