This repository was archived by the owner on Feb 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
52 lines (50 loc) · 1.84 KB
/
Jenkinsfile
File metadata and controls
52 lines (50 loc) · 1.84 KB
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
pipeline {
agent any
tools {nodejs "Node891"}
stages {
stage('Checkout') {
steps {
slackSend color: 'good', channel: "#ci-build", message: "PLUTO-DECLARATION BUILD & DEPLOY just Started: ${env.JOB_NAME}"
checkout scm
sh 'git status'
}
}
stage('Install dependencies'){
steps {
script {
try {
sh 'rm -rf node_modules'
sh 'npm cache clean -f'
sh 'npm install'
} catch (err) {
slackSend color: "danger", channel: "#ci-build", failOnError: true, message: "Build Failed at NPM INSTALL: ${env.JOB_NAME}"
throw err
}
}
}
}
stage('Deploy') {
steps {
script {
try {
if (env.BRANCH_NAME == 'master') {
sh 'npm run deploy:prod'
} else {
sh 'npm run deploy:stage'
}
} catch (err) {
slackSend color: "danger", failOnError: true, message: "Build Failed at BUILD & DEPLOY: ${env.JOB_NAME}"
throw err
}
def targetUrl;
if (env.BRANCH_NAME == 'master') {
targetUrl = "https://join.pluto.network"
} else {
targetUrl = "https://join-stage.pluto.network"
}
slackSend color: 'good', channel: "#ci-build", message: "PLUTO-DECLARATION Build DONE! ${env.JOB_NAME} please check ${targetUrl}"
}
}
}
}
}