2024-05-31 13:00:16 +00:00
|
|
|
#!/usr/bin/env groovy
|
2024-06-06 11:06:11 +00:00
|
|
|
library 'status-jenkins-lib@v1.8.16'
|
2024-05-31 13:00:16 +00:00
|
|
|
|
2023-04-05 09:46:17 +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-05-31 13:00:16 +00:00
|
|
|
sh 'yarn install'
|
2023-04-05 09:46:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-05-31 13:00:16 +00:00
|
|
|
script {
|
|
|
|
sh 'yarn build'
|
|
|
|
jenkins.genBuildMetaJSON('build/build.json')
|
2023-04-05 09:46:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-31 13:00:16 +00:00
|
|
|
stage('Publish') {
|
2023-04-05 09:46:17 +00:00
|
|
|
steps {
|
2024-05-31 13:00:16 +00:00
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
2023-06-07 20:46:39 +00:00
|
|
|
sh """
|
2024-05-31 13:00:16 +00:00
|
|
|
ghp-import \
|
|
|
|
-b ${deployBranch()} \
|
|
|
|
-c ${deployDomain()} \
|
|
|
|
-p build
|
2023-06-07 20:46:39 +00:00
|
|
|
"""
|
2024-05-31 13:00:16 +00:00
|
|
|
}
|
2023-04-05 09:46:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
2024-05-31 13:00:16 +00:00
|
|
|
|
|
|
|
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
|
|
|
|
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
|
|
|
|
def deployDomain() { isMasterBranch() ? 'afaik.institute' : 'dev.afaik.institute' }
|