2018-09-28 18:47:04 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'linux' }
|
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
GIT_USER = 'status-im-auto'
|
|
|
|
GIT_MAIL = 'auto@status.im'
|
2021-09-23 16:39:17 +00:00
|
|
|
/* Dev site deployment. */
|
|
|
|
DEV_SITE = 'dev.nimbus.team'
|
|
|
|
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
|
|
|
|
SCP_OPTS = 'StrictHostKeyChecking=no'
|
2018-09-28 18:47:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
|
|
|
stage('Install Deps') {
|
|
|
|
steps {
|
2022-01-05 12:27:13 +00:00
|
|
|
sh 'yarn install'
|
2018-09-28 18:47:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2022-01-05 12:27:13 +00:00
|
|
|
sh 'yarn run clean'
|
|
|
|
sh 'yarn run build'
|
2018-09-28 18:47:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-19 12:58:26 +00:00
|
|
|
stage('Robot') {
|
|
|
|
when { expression { !GIT_BRANCH.endsWith('master') } }
|
|
|
|
steps { script {
|
|
|
|
sh 'echo "Disallow: /" >> public/robots.txt'
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
2018-09-28 18:47:04 +00:00
|
|
|
stage('Publish Prod') {
|
2019-06-19 12:58:26 +00:00
|
|
|
when { expression { GIT_BRANCH.endsWith('master') } }
|
2018-09-28 18:47:04 +00:00
|
|
|
steps { script {
|
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
2022-01-05 12:27:13 +00:00
|
|
|
sh 'yarn run deploy'
|
2018-09-28 18:47:04 +00:00
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish Devel') {
|
2019-06-19 12:58:26 +00:00
|
|
|
when { expression { !GIT_BRANCH.endsWith('master') } }
|
2018-09-28 18:47:04 +00:00
|
|
|
steps { script {
|
|
|
|
sshagent(credentials: ['jenkins-ssh']) {
|
2021-09-23 16:39:17 +00:00
|
|
|
sh """
|
|
|
|
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete public/. \
|
|
|
|
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
|
|
|
|
"""
|
2018-09-28 18:47:04 +00:00
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
2018-10-04 17:33:20 +00:00
|
|
|
}
|