2024-02-19 13:51:49 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
library 'status-jenkins-lib@v1.8.8'
|
|
|
|
|
2023-03-16 13:21:27 +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-02-19 14:06:46 +00:00
|
|
|
sh 'yarn install'
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
2024-02-19 13:51:49 +00:00
|
|
|
steps { script {
|
2023-11-17 14:37:34 +00:00
|
|
|
/* Issues from waku-org/bounties are fetched. */
|
|
|
|
withCredentials([
|
|
|
|
string(
|
|
|
|
credentialsId: 'waku-org-bounties-access-gh-token',
|
|
|
|
variable: 'GITHUB_ACCESS_TOKEN'
|
|
|
|
),
|
|
|
|
]) {
|
|
|
|
sh 'yarn build'
|
|
|
|
}
|
2024-02-19 14:06:46 +00:00
|
|
|
jenkins.genBuildMetaJSON('build/build.json')
|
2024-02-19 13:51:49 +00:00
|
|
|
} }
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
|
2024-02-19 14:06:46 +00:00
|
|
|
stage('Publish') {
|
2023-03-16 13:21:27 +00:00
|
|
|
steps {
|
2023-06-01 20:48:43 +00:00
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
|
|
|
sh """
|
2024-02-19 14:06:46 +00:00
|
|
|
ghp-import \
|
|
|
|
-b ${deployBranch()} \
|
|
|
|
-c ${deployDomain()} \
|
|
|
|
-p build
|
2023-06-01 20:48:43 +00:00
|
|
|
"""
|
2023-03-16 13:21:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
2024-02-19 14:06:46 +00:00
|
|
|
|
|
|
|
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
|
|
|
|
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
|
|
|
|
def deployDomain() { isMasterBranch() ? 'waku.org' : 'dev.waku.org' }
|