-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
74 lines (69 loc) · 2.21 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
69
70
71
72
73
74
import groovy.json.JsonOutput
SUCCESS_STAGE = 'build'
STEPS = 'build Testing REES46 PersonaClick Kameleoon'
def stepPublisher(step, style) {
rabbitMQPublisher(rabbitName: 'rabbit', exchange: '', routingKey: 'notification', conversion: false,
data: JsonOutput.toJson([type: "deploy", project: JOB_NAME, style: style, step: step, message: GIT_COMMIT_MSG, commit: GIT_COMMIT, url: COMMIT_URL, author: GIT_COMMIT_AUTHOR, console: "${BUILD_URL}console", steps: STEPS]))
}
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'bin/prepare_for_jenkins'
script {
env.GIT_COMMIT_MSG = sh (script: 'git log -1 --pretty=%B ${GIT_COMMIT}', returnStdout: true).trim()
env.GIT_COMMIT_AUTHOR = sh (script: 'git log -1 --pretty=%an ${GIT_COMMIT}', returnStdout: true).trim()
env.COMMIT_URL = "https://github.com/rees46/api-docs/commit/${GIT_COMMIT}"
}
}
}
stage('Testing') {
steps {
script {
SUCCESS_STAGE = 'testing'
}
// stepPublisher(SUCCESS_STAGE, 'SECONDARY')
sh 'bin/testing'
}
}
stage('REES46') {
steps {
script {
SUCCESS_STAGE = 'rees46'
}
stepPublisher(SUCCESS_STAGE, 'SECONDARY')
sh 'bin/deploy_r46'
}
}
stage('PersonaClick') {
steps {
script {
SUCCESS_STAGE = 'PersonaClick'
}
stepPublisher(SUCCESS_STAGE, 'SECONDARY')
sh 'bin/deploy_pc'
}
}
stage('Kameleoon') {
steps {
script {
SUCCESS_STAGE = 'Kameleoon'
}
stepPublisher(SUCCESS_STAGE, 'SECONDARY')
sh 'bin/deploy_kameleoon'
}
}
}
post {
failure {
stepPublisher(SUCCESS_STAGE, 'ERROR')
}
aborted {
stepPublisher(SUCCESS_STAGE, 'WARNING')
}
success {
stepPublisher(SUCCESS_STAGE, 'SUCCESS')
}
}
}