2024-04-22 16:02:08 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
library 'status-jenkins-lib@v1.8.8'
|
|
|
|
|
2023-06-01 22:01:37 +00:00
|
|
|
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'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Install') {
|
|
|
|
steps {
|
2024-04-22 16:02:08 +00:00
|
|
|
sh 'yarn install'
|
2023-06-01 22:01:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
2024-04-22 16:02:08 +00:00
|
|
|
steps { script {
|
2023-06-01 22:01:37 +00:00
|
|
|
sh 'yarn build'
|
2024-04-22 16:02:08 +00:00
|
|
|
jenkins.genBuildMetaJSON('build/build.json')
|
|
|
|
} }
|
2023-06-01 22:01:37 +00:00
|
|
|
}
|
|
|
|
|
2024-04-22 16:02:08 +00:00
|
|
|
stage('Publish') {
|
2023-06-01 22:01:37 +00:00
|
|
|
steps {
|
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
|
|
|
sh """
|
2024-04-22 16:02:08 +00:00
|
|
|
ghp-import \
|
|
|
|
-b ${deployBranch()} \
|
|
|
|
-c ${deployDomain()} \
|
|
|
|
-p build
|
2023-06-01 22:01:37 +00:00
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-22 16:02:08 +00:00
|
|
|
}
|
2023-06-01 22:01:37 +00:00
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
2024-04-22 16:02:08 +00:00
|
|
|
|
|
|
|
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
|
|
|
|
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
|
|
|
|
def deployDomain() { isMasterBranch() ? 'nimbus.team' : 'dev.nimbus.team' }
|