Merge pull request #14 from acid-info/jenkins-ci

add Jenkinsfile
This commit is contained in:
SWB 2023-03-14 11:28:42 +00:00 committed by GitHub
commit 599cc26716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 81 additions and 0 deletions

80
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,80 @@
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* Necessary for logos-side-builder local_folder source type. */
checkoutToSubdirectory('src')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
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'
/* dev page settings */
DEV_SITE = 'dev.logos.co'
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'
}
}
}
stage('Build') {
steps {
dir('builder') {
sh 'yarn build'
}
}
}
stage('Publish Prod') {
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
sh "ghp-import -p public"
}
}
}
stage('Publish Devel') {
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
steps {
sshagent(credentials: ['jenkins-ssh']) {
sh """
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete public/. \
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
"""
}
}
}
}
post {
cleanup { cleanWs() }
}
}

1
static-assets/CNAME Normal file
View File

@ -0,0 +1 @@
logos.co