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'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
|
|
|
stage('Install Deps') {
|
|
|
|
steps {
|
|
|
|
sh 'npm install'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
sh 'npm run clean'
|
|
|
|
sh 'npm run build'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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']) {
|
|
|
|
sh 'npm run deploy'
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
|
|
|
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']) {
|
|
|
|
sh '''
|
2019-03-31 09:39:58 +00:00
|
|
|
rsync -e 'ssh -o StrictHostKeyChecking=no' -r --delete public/. \
|
2018-10-04 17:33:20 +00:00
|
|
|
jenkins@node-01.do-ams3.proxy.misc.statusim.net:/var/www/dev-nimbus/
|
2018-09-28 18:47:04 +00:00
|
|
|
'''
|
|
|
|
}
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
2018-10-04 17:33:20 +00:00
|
|
|
}
|