2024-07-16 15:18:38 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
library 'status-jenkins-lib@v1.8.8'
|
|
|
|
|
2023-06-01 20:22:28 +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-07-23 20:19:52 +00:00
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
nix.develop('yarn install')
|
|
|
|
}
|
2023-06-01 20:22:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-07-16 15:18:38 +00:00
|
|
|
script {
|
2024-07-23 20:19:52 +00:00
|
|
|
nix.develop('yarn build')
|
2024-07-16 15:18:38 +00:00
|
|
|
jenkins.genBuildMetaJSON('build/build.json')
|
2023-06-01 20:22:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-16 15:18:38 +00:00
|
|
|
stage('Publish') {
|
2023-06-01 20:22:28 +00:00
|
|
|
steps {
|
2024-07-16 15:18:38 +00:00
|
|
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
2024-07-25 09:06:56 +00:00
|
|
|
script {
|
2024-07-25 09:14:48 +00:00
|
|
|
nix.develop("""
|
2024-07-25 09:06:56 +00:00
|
|
|
ghp-import \
|
|
|
|
-b ${deployBranch()} \
|
|
|
|
-c ${deployDomain()} \
|
|
|
|
-p build
|
2024-07-25 09:14:48 +00:00
|
|
|
"""
|
2024-07-25 09:06:56 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-06-01 20:22:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
2024-07-16 15:18:38 +00:00
|
|
|
|
|
|
|
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
|
|
|
|
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
|
|
|
|
def deployDomain() { isMasterBranch() ? 'logos.co' : 'dev.logos.co' }
|