fix jenkinsfile

This commit is contained in:
swb 2023-06-07 22:01:25 +01:00
parent cecd8f2fac
commit fd6148e160
No known key found for this signature in database
GPG Key ID: 00C65C3C5258DB0F
1 changed files with 10 additions and 35 deletions

45
Jenkinsfile vendored
View File

@ -3,8 +3,6 @@ pipeline {
options {
disableConcurrentBuilds()
/* Necessary for logos-side-builder local_folder source type. */
checkoutToSubdirectory('src')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
@ -13,10 +11,6 @@ pipeline {
}
environment {
/* Mode of logos-site-builder for copying site source from already checked out repo.
* TODO: Avoid copying anything at all, make checkout site of into `docs` folder work. */
CONTENT_SOURCE_TYPE = 'local_folder'
CONTENT_SOURCE_URL = '../src'
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
PROD_SITE = 'acid.info'
@ -26,41 +20,24 @@ pipeline {
}
stages {
stage('Clone Builder') {
steps {
dir('builder') {
checkout([$class: 'GitSCM',
branches: [[name: 'v0']],
userRemoteConfigs: [[url: 'https://github.com/acid-info/logos-site-builder']]])
}
}
}
stage('Install') {
steps {
dir('builder') {
sh 'yarn install'
}
sh "yarn install"
}
}
stage('Build') {
steps {
dir('builder') {
sh 'yarn build'
sh "echo ${env.PROD_SITE} > out/CNAME"
}
sh 'yarn build'
sh "echo ${env.PROD_SITE} > build/CNAME"
}
}
stage('Publish Prod') {
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
steps {
dir('src') {
sh 'cp -r ../builder/out ./'
sshagent(credentials: ['status-im-auto-ssh']) {
sh "ghp-import -p out"
}
sshagent(credentials: ['status-im-auto-ssh']) {
sh "ghp-import -p build"
}
}
}
@ -68,13 +45,11 @@ pipeline {
stage('Publish Devel') {
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
steps {
dir('builder') {
sshagent(credentials: ['jenkins-ssh']) {
sh """
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete out/. \
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
"""
}
sshagent(credentials: ['jenkins-ssh']) {
sh """
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete build/. \
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
"""
}
}
}