This repository was archived by the owner on Aug 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
60 lines (60 loc) · 2.17 KB
/
Jenkinsfile
File metadata and controls
60 lines (60 loc) · 2.17 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
pipeline {
agent { label 'linux' }
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
timestamps()
}
triggers { cron('@weekly') }
environment {
CI = 'true'
CONTAINER = 'prometheus'
}
stages {
stage('Build') {
steps {
script {
props = readProperties file: "./version"
image = docker.build("utexas-glib-it-docker-local.jfrog.io/${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER}", "--pull ./ ")
}
}
}
stage('Test') {
steps {
script {
sh "export GOSS_FILES_STRATEGY=cp; \
GOSS_PATH='/usr/local/bin/goss' \
GOSS_OPTS='--format junit --no-color' \
GOSS_SLEEP='15' \
/usr/local/bin/dgoss run \
utexas-glib-it-docker-local.jfrog.io/${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER} \
| grep -v INFO | grep -v UID > ./goss.xml"
step([$class: 'JUnitResultArchiver', testResults: 'goss.xml'])
}
}
}
}
post {
always {
deleteDir()
}
success {
script {
image.push()
image.push("${props.MAJOR}.${props.MINOR}.${props.HOTFIX}")
image.push("${props.MAJOR}.${props.MINOR}")
image.push("${props.MAJOR}")
image.push('latest')
}
slackSend message: "${currentBuild.currentResult}: ${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
failure {
slackSend message: "${currentBuild.currentResult}: ${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
unstable {
slackSend message: "${currentBuild.currentResult}: ${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
changed {
slackSend message: "${currentBuild.currentResult}: ${props.NAME}-${props.RELEASE}:${props.MAJOR}.${props.MINOR}.${props.HOTFIX}-${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
}
}