Files

72 lines
1.5 KiB
Groovy
Raw Permalink Normal View History

2024-07-17 09:14:34 +05:30
#!/usr/bin/env groovy
2025-08-03 18:25:02 +05:30
library 'status-jenkins-lib@v1.9.24'
2024-07-17 09:14:34 +05:30
2023-03-16 11:04:50 +00:00
pipeline {
2025-10-22 22:00:44 +02:00
agent {
docker {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/nix:/nix ' +
'--volume=/etc/nix:/etc/nix '
}
}
2023-03-16 11:04:50 +00:00
options {
disableConcurrentBuilds()
2026-06-03 09:51:02 +02:00
timeout(time: 30, unit: 'MINUTES')
2023-03-16 11:04:50 +00:00
/* 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 {
2025-08-03 18:25:02 +05:30
script {
nix.develop('yarn install')
}
2023-03-16 11:04:50 +00:00
}
}
stage('Build') {
steps {
2024-07-17 09:14:34 +05:30
script {
2025-08-03 18:25:02 +05:30
nix.develop('yarn build')
2024-07-17 09:14:34 +05:30
jenkins.genBuildMetaJSON('build/build.json')
}
2023-03-16 11:04:50 +00:00
}
}
2024-07-17 09:14:34 +05:30
stage('Publish') {
2023-03-16 11:04:50 +00:00
steps {
2023-06-08 00:42:28 +03:30
sshagent(credentials: ['status-im-auto-ssh']) {
2025-08-03 18:25:02 +05:30
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p build
""", sandbox: false,
keepEnv: ['SSH_AUTH_SOCK'])
}
2024-07-17 09:14:34 +05:30
}
2023-03-16 11:04:50 +00:00
}
}
}
post {
cleanup { cleanWs() }
}
}
2024-07-17 09:14:34 +05:30
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
2026-02-13 14:02:09 +01:00
def deployDomain() { isMasterBranch() ? 'research.logos.co' : 'dev-research.logos.co' }