add jenkinsfile
This commit is contained in:
parent
baafec26c9
commit
5bee65a163
|
@ -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,54 +11,33 @@ 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'
|
||||
DEV_SITE = 'dev.acid.info'
|
||||
PROD_SITE = 'afaik.institute'
|
||||
DEV_SITE = 'dev.afaik.institute'
|
||||
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
|
||||
SCP_OPTS = 'StrictHostKeyChecking=no'
|
||||
}
|
||||
|
||||
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}/
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue