64 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.16'
2024-09-11 00:58:57 +09:00
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}"
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
2024-09-11 00:58:57 +09:00
}
stages {
stage('Install') {
2024-09-11 00:58:57 +09:00
steps {
2024-12-13 18:59:12 +05:30
script {
nix.develop('yarn install')
}
2024-09-11 00:58:57 +09:00
}
}
stage('Build') {
steps {
script {
2024-12-13 18:59:12 +05:30
nix.develop('yarn build')
2024-12-16 16:08:01 +05:30
jenkins.genBuildMetaJSON('out/build.json')
2024-09-11 00:58:57 +09:00
}
}
2024-09-11 00:58:57 +09:00
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
2024-12-13 18:59:12 +05:30
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
2024-12-13 19:51:03 +05:30
-p out
2024-12-13 18:59:12 +05:30
""", pure: false)
}
}
}
2024-09-11 00:58:57 +09:00
}
}
post {
cleanup { cleanWs() }
}
}
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'dashboard.logos.co' : 'dev-dashboard.logos.co' }