forked from status-im/nimbus-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
64 lines (57 loc) · 1.39 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
pipeline {
agent { label 'linux' }
options {
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_USER = 'status-im-auto'
GIT_MAIL = 'auto@status.im'
}
stages {
stage('Git Prep') {
steps {
sh "git config user.name ${env.GIT_USER}"
sh "git config user.email ${env.GIT_MAIL}"
/* necessary to have access to the theme partials */
sshagent(credentials: ['status-im-auto-ssh']) {
sh 'git submodule update --init --recursive'
}
}
}
stage('Install Deps') {
steps {
sh 'npm install'
}
}
stage('Build') {
steps {
sh 'npm run clean'
sh 'npm run build'
}
}
stage('Publish Prod') {
when { expression { env.GIT_BRANCH ==~ /.*master/ } }
steps { script {
sshagent(credentials: ['status-im-auto-ssh']) {
sh 'npm run deploy'
}
} }
}
stage('Publish Devel') {
when { expression { env.GIT_BRANCH ==~ /.*develop/ } }
steps { script {
sshagent(credentials: ['jenkins-ssh']) {
sh '''
scp -o StrictHostKeyChecking=no -r public/. \
jenkins@node-01.do-ams3.proxy.misc.statusim.net:/var/www/dev-nimbus/
'''
}
} }
}
}
}