-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (48 loc) · 1.64 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
options {
copyArtifactPermission('Grafana.Builder/*')
}
stages {
stage('Pre Build') {
steps {
slackSend (color: '#D4DADF', message: "Starting: Grafana - NGSI-LD plugin on branch ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open>)")
}
}
stage('Build backend') {
steps {
sh 'mage -v'
}
}
stage('Build frontend') {
steps {
sh 'npm install'
sh 'npm run-script build'
}
}
stage('Archive deliverable') {
steps {
sh 'tar czvf dist.tar.gz dist'
archiveArtifacts artifacts: 'dist.tar.gz', fingerprint: false
}
}
stage('Start Grafana builder job') {
steps {
script {
if (env.BRANCH_NAME == 'master')
build job: "Grafana.Builder/master", wait: false
else if (env.BRANCH_NAME == 'develop')
build job: "Grafana.Builder/develop", wait: false
}
}
}
}
post {
success {
slackSend (color: '#36b37e', message: "Success: Grafana - NGSI-LD plugin on branch ${env.BRANCH_NAME} after ${currentBuild.durationString.replace(' and counting', '')} (<${env.BUILD_URL}|Open>)")
}
failure {
slackSend (color: '#FF0000', message: "Fail: Grafana - NGSI-LD plugin on branch ${env.BRANCH_NAME} after ${currentBuild.durationString.replace(' and counting', '')} (<${env.BUILD_URL}|Open>)")
}
}
}