-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
48 lines (42 loc) · 1.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
pipeline {
agent any
environment {
PM2_SERVICE_APP = "${env.BRANCH_NAME == 'main' ? 'main-app' : 'next'}"
PM2_SERVICE_INDEXER = "${env.BRANCH_NAME == 'main' ? 'main-indexer' : 'indexer'}"
}
triggers {
githubPush() // Trigger
}
stages {
stage('Checkout code') {
steps {
git branch: "${env.BRANCH_NAME}", url: 'https://github.com/citizenweb3/validatorinfo.git'
}
}
stage('Install dependencies') {
steps {
script {
sh 'yarn'
sh 'make generate-schema'
sh 'yarn build'
sh "pm2 restart ${PM2_SERVICE_APP}"
}
}
}
stage('Indexer') {
steps {
script {
sh "pm2 restart ${PM2_SERVICE_INDEXER}"
}
}
}
}
post {
always {
script {
sh 'pm2 save'
sh 'pm2 list'
}
}
}
}