-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
114 lines (107 loc) · 3.91 KB
/
Copy pathJenkinsfile
File metadata and controls
114 lines (107 loc) · 3.91 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
def PROJET = 'mcumediaserver'
def PROJET2 = ''
import hudson.model.*
import jenkins.model.*
import hudson.tasks.test.AbstractTestResultAction
pipeline {
agent none
//parameters {
// booleanParam(name: 'SIGNRPM', defaultValue: false, description: 'Signer le RPM ?')
// string(name: 'PARAPHRASE', defaultValue: '' , description: 'Paraphrase de la cle de signature')
//}
stages {
//stage('Verification paraphrase') {
// agent { label 'centos6' }
// when {
// expression { params.SIGNRPM }
// }
// steps {
// sh """
// git clone --depth 1 git@git.ives.fr:internal/gnupg.git
// rm -rf gnupg/.git
// echo "${params.PARAPHRASE}" | gpg -q --local-user IVeSkey --batch --homedir ./gnupg/ --passphrase-fd 0 --sign > /dev/null
// """
// }
//}
stage('CompilEtInstalle') {
matrix {
agent { label "${NODELABEL}" }
axes {
axis {
name 'NODELABEL'
//values 'centos6', 'centos7'
values 'centos6'
}
}
stages {
stage('Generation RPM') {
steps {
sh """
./install.ksh prereq
./install.ksh rpm nosign
"""
}
}
//stage('Signer le RPM') {
// when {
// expression { params.SIGNRPM }
// }
// steps {
// sh """
// git clone --depth 1 git@git.ives.fr:internal/gnupg.git
// rm -rf gnupg/.git
// echo \"${params.PASSPHRASE}\" | rpm --resign ${PROJET}*.rpm
// rm -rf ./gnupg
// """
// }
//}
stage('Inst. le RPM') {
when {
buildingTag()
}
steps {
sh """
sudo yum remove -y ${PROJET}
sudo yum localinstall -y ${PROJET}*.rpm
"""
}
}
stage('archive') {
when {
buildingTag()
}
steps {
archiveArtifacts(artifacts: '*.rpm,vrn.html', onlyIfSuccessful: true)
}
}
} // stages
post {
failure {
script {
notifFail("Failed to build RPM on ${NODELABEL}")
}
}
}
} // matrix
} // stage('BuildAndInstall')
} // stages
post {
success {
script{
notifSuccess()
}
}
}
}
void notifFail(e)
{
office365ConnectorSend(message: "💔: *BUILD FAIL asteriskv $BRANCH_NAME* : \n\n Lien du Build : <RUN_DISPLAY_URL|JENKINS-#$BUILD_NUMBER> \n \n Cordialement, Jenkins", status: 'Success', webhookUrl: 'https://outlook.office.com/webhook/a8d2a9bb-d91a-48b9-8774-a1907c4bce10@dda7df9a-8948-410e-8cd6-c830a3370b09/JenkinsCI/1c7e9437aaad42a8a2407afabdbfc096/37c3465b-9ab9-4181-8220-d38b79c27fe3', color:'00ff00')
}
void notifSuccess()
{
office365ConnectorSend(message: "✅: *BUILD SUCCESS asteriskv $BRANCH_NAME* : \n\n Lien du Build <$RUN_DISPLAY_URL|JENKINS-#$BUILD_NUMBER> \n \n Cordialement, Jenkins", status: 'Success', webhookUrl: 'https://outlook.office.com/webhook/a8d2a9bb-d91a-48b9-8774-a1907c4bce10@dda7df9a-8948-410e-8cd6-c830a3370b09/JenkinsCI/1c7e9437aaad42a8a2407afabdbfc096/37c3465b-9ab9-4181-8220-d38b79c27fe3', color:'00ff00')
}
void notifSuccessInstalled()
{
office365ConnectorSend(message: "✅: *BUILD SUCCESS asteriskv $BRANCH_NAME* : \n\n Lien du Build : $RUN_DISPLAY_URL|JENKINS-#$BUILD_NUMBER> \n \n Cordialement, Jenkins", status: 'Success', webhookUrl: 'https://outlook.office.com/webhook/a8d2a9bb-d91a-48b9-8774-a1907c4bce10@dda7df9a-8948-410e-8cd6-c830a3370b09/JenkinsCI/1c7e9437aaad42a8a2407afabdbfc096/37c3465b-9ab9-4181-8220-d38b79c27fe3', color:'00ff00')
}