guide.nimbus.team/Jenkinsfile

64 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.8.8'
2023-11-24 14:50:07 +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') {
2024-08-20 12:15:15 +00:00
steps {
script {
nix.develop('yarn install')
}
2023-11-24 14:50:07 +00:00
}
}
stage('Build') {
steps {
script {
2024-08-20 12:15:15 +00:00
nix.develop('yarn build')
2024-09-17 08:52:27 +00:00
jenkins.genBuildMetaJSON('build/build.json')
2023-11-24 14:50:07 +00:00
}
}
}
stage('Publish') {
2023-11-24 14:50:07 +00:00
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
2024-08-20 12:15:15 +00:00
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
2024-09-17 08:52:27 +00:00
-p build
2024-08-20 12:15:15 +00:00
"""
)
}
}
2023-11-24 14:50:07 +00:00
}
}
}
post {
cleanup { cleanWs() }
}
}
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'guide.nimbus.team' : 'dev-guide.nimbus.team' }