add Jenkinsfile for CI builds

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-09-29 13:35:01 +02:00
parent 2c37cb17f2
commit 0de2927b07
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 56 additions and 1 deletions

50
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,50 @@
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
/* dev page settings */
DEV_SITE = 'dev-docs.dappconnect.dev'
DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net'
SCP_OPTS = 'StrictHostKeyChecking=no'
}
stages {
stage('Build') {
steps {
sh 'mdbook build'
}
}
stage('Publish Prod') {
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
sh "ghp-import -p book"
}
}
}
stage('Publish Devel') {
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
steps {
sshagent(credentials: ['jenkins-ssh']) {
sh """
rsync -e 'ssh -o ${SCP_OPTS}' -r --delete book/. \
${env.DEV_HOST}:/var/www/${env.DEV_SITE}/
"""
}
}
}
}
}

View File

@ -16,4 +16,9 @@ Will expose the built page under http://localhost:3000/.
# Continuous Integration
__TODO__
Two branches are built by [our Jenkins instance](https://ci.status.im/):
* `master` is deployed to https://docs.dappconnect.dev/ by [CI](https://ci.status.im/job/website/job/docs.dappconnect.dev/)
* `develop` is deployed to https://dev-docs.dappconnect.dev/ by [CI](https://ci.status.im/job/website/job/dev-docs.dappconnect.dev/)
PRs should be made for `develop` branch and `master` should be [rebased](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) on `develop` once changes are verified.