-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
47 lines (47 loc) · 1.47 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
pipeline {
agent none
options {
checkoutToSubdirectory('pcc-ui')
newContainerPerStage()
}
environment {
PROJECT_DIR='pcc-ui'
}
stages {
stage ('Build and Deploy pcc-ui') {
agent {
docker {
image 'node:lts-buster'
}
}
steps {
echo 'Build pcc-ui'
sh '''
cd $WORKSPACE/$PROJECT_DIR
npm install
CI=false npm run build
'''
}
}
}
post {
success {
script{
if ( env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rocket: New version for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME !")
slackSend( message: ":satellite: New version of <$BUILD_URL|$PROJECT_DIR> built successfully to devel!")
}
else if ( env.BRANCH_NAME == 'master' ) {
slackSend( message: ":rocket: New version for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME !")
}
}
}
failure {
script{
if ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'devel' ) {
slackSend( message: ":rain_cloud: Build Failed for <$BUILD_URL|$PROJECT_DIR>:$BRANCH_NAME Job: $JOB_NAME")
}
}
}
}
}