-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
42 lines (40 loc) · 1.36 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
pipeline {
agent {
label 'load-test'
}
parameters {
choice( name: 'SERVER_STATUS',
choices: ['Start','Restart', 'Stop'],
description: 'Please choose if you would like to Start/Restart/Stop the server')
}
stages {
stage('Completing Task') {
steps {
echo "Server Status : ${params.SERVER_STATUS}"
script {
if ("${params.SERVER_STATUS}" == 'Start'){
echo "Starting Server"
sh """
cd hoverfly_stub
JENKINS_NODE_COOKIE=dontKillMe ./start_stub_server.sh
"""
}
else if ("${params.SERVER_STATUS}" == 'Stop'){
echo "Stopping Server"
sh """
cd hoverfly_stub
./stop_stub_server.sh
"""
}
else {
echo "Restarting Server"
sh """
cd hoverfly_stub
JENKINS_NODE_COOKIE=dontKillMe ./restart_stub_server.sh
"""
}
}
}
}
}
}