forked from acid-info/rnd-rfc.vac.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (55 loc) · 1.25 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env groovy
library '[email protected]'
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 = '[email protected]'
INCLUDED_DIRS = 'codex,nomos,status,vac,waku'
FETCH_MODE = 'git'
}
stages {
stage('Install') {
steps {
sh 'yarn install'
}
}
stage('Scrape') {
steps {
sh 'yarn scrape'
}
}
stage('Build') {
steps { script {
sh 'yarn build'
jenkins.genBuildMetaJSON('build/build.json')
} }
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
sh """
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p build
"""
}
}
}
}
post {
cleanup { cleanWs() }
}
}
def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'rfc.vac.dev' : 'dev-rfc.vac.dev' }