forked from SingularDTV/snglsDAO-smartcontracts
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
68 lines (68 loc) · 2.06 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
65
66
67
68
pipeline {
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5'))
}
agent {
node {
label 'ubuntu-18.04'
}
}
stages {
stage('INIT') {
steps {
nodejs('nodejs-10') {
sh 'cd dao-web-app/ && npm install'
}
}
}
// stage('BUILD') {
// steps {
// nodejs('nodejs-10') {
// sh 'cd dao-web-app/ && npm run build-dev'
// }
// }
// }
stage('develop(rinkeby) -> https://snglsdao.blaize.tech') {
when {
branch 'develop'
}
steps {
nodejs('nodejs-10') {
sh 'cd dao-web-app/ && npm run build-rinkeby'
}
sshagent(['snglsdao-www']) {
sh 'rsync -a --verbose --delete -e "ssh -o StrictHostKeyChecking=no" dao-web-app/dist/ [email protected]:/var/www/snglsdao.blaize.tech/'
}
}
}
stage('pre-production(main) -> https://stageapp.snglsdao.io/') {
when {
branch 'pre-production'
}
steps {
nodejs('nodejs-10') {
sh 'cd dao-web-app/ && npm run build'
// we archive as we can actually use this for deploy on prod without the build of production branch
archiveArtifacts(artifacts: 'dao-web-app/dist/', onlyIfSuccessful: true)
}
sshagent(['snglsdao-www']) {
sh 'rsync -a --verbose --delete -e "ssh -o StrictHostKeyChecking=no" dao-web-app/dist/ [email protected]:/var/www/stageapp.snglsdao.io/'
}
}
}
stage('production(main) -> https://app.snglsdao.io/') {
when {
branch 'production'
}
steps {
nodejs('nodejs-10') {
sh 'cd dao-web-app/ && npm run build'
archiveArtifacts(artifacts: 'dao-web-app/dist/', onlyIfSuccessful: true)
// the installation controlled by separate job in jenkins
// https://jenkins.blaize.tech/view/snglsdao/job/prod-snglsdao-deploy-app.snglsdao.io/
}
}
}
}
}