-
Notifications
You must be signed in to change notification settings - Fork 30
/
Jenkinsfile
98 lines (92 loc) · 2.51 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env groovy
pipeline {
agent any
options {
timeout(time: 15, unit: 'MINUTES')
}
triggers {
cron('H 2 * * *')
}
environment {
GMT_COMPOSE_FILE = 'gmt-docker-compose.yml'
GMT_HTTP_PORT = "18090"
PARTICLES_EXPORT_URL = "http://127.0.0.1:${GMT_HTTP_PORT}/winery/servicetemplates"
TOUCH_URL = "http://127.0.0.1:${GMT_HTTP_PORT}/winery/admin/repository/touch"
}
stages {
stage('Ensure clean and up to date environment') {
steps {
sh "docker-compose -f ${GMT_COMPOSE_FILE} rm -fsv"
sh "docker-compose -f ${GMT_COMPOSE_FILE} pull"
}
}
stage('Set up and start GMT') {
steps {
sh "chmod -R a+rwx ."
sh "docker-compose -f ${GMT_COMPOSE_FILE} up -d"
sh "sleep 30"
}
}
stage('Touch the repository') {
steps {
sh "curl -X POST --fail \"${TOUCH_URL}\""
}
}
stage('Obtain radon.blueprints Service Templates') {
matrix {
axes {
axis {
name 'SERVICE_TEMPLATE'
values 'SockShopTestingExample', 'ThumbnailGeneration'
}
axis {
name 'NAMESPACE'
values 'radon.blueprints'
}
}
stages {
stage('Query Service Template') {
environment {
CSAR = "${NAMESPACE}.${SERVICE_TEMPLATE}.csar"
}
steps {
sh "curl -H 'Accept: application/xml' -o \"${CSAR}\" \"${PARTICLES_EXPORT_URL}/${NAMESPACE}/${SERVICE_TEMPLATE}/?yaml&csar\""
archiveArtifacts artifacts: "${CSAR}", onlyIfSuccessful: true
}
}
}
}
}
stage('Obtain radon.blueprints.testing Service Templates') {
matrix {
axes {
axis {
name 'SERVICE_TEMPLATE'
values 'JMeterMasterOnly', 'DeploymentTestAgent'
}
axis {
name 'NAMESPACE'
values 'radon.blueprints.testing'
}
}
stages {
stage('Query Service Template') {
environment {
CSAR = "${NAMESPACE}.${SERVICE_TEMPLATE}.csar"
}
steps {
sh "curl -H 'Accept: application/xml' -o \"${CSAR}\" \"${PARTICLES_EXPORT_URL}/${NAMESPACE}/${SERVICE_TEMPLATE}/?yaml&csar\""
archiveArtifacts artifacts: "${CSAR}", onlyIfSuccessful: true
}
}
}
}
}
}
post {
always {
sh "docker-compose -f ${GMT_COMPOSE_FILE} rm -fsv"
cleanWs()
}
}
}