-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
30 lines (27 loc) · 1.15 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
node {
def buildNumber = env.BUILD_NUMBER
def workspace = env.WORKSPACE
def buildUrl = env.BUILD_URL
def imageRepo = "https://hub.docker.com/r/rafazzevedo/artilleryexamples"
// PRINT ENVIRONMENT TO JOB
echo "workspace directory is $workspace"
echo "build URL is $buildUrl"
echo "build Number is $buildNumber"
echo "PATH is $env.PATH"
properties([
disableConcurrentBuilds(),
parameters([
choice(name: 'ENVIRONMENT', choices: "qa\ndev", description: 'Environment to run the tests')
])
])
wrap([$class: 'AnsiColorBuildWrapper']) {
stage('Performance Tests') {
echo "Running Performance Tests on ${ENVIRONMENT}"
sh "kubectl run performance-tests -i --rm --namespace=${ENVIRONMENT} --restart=Never --image=${imageRepo}:latest --image-pull-policy=Always -- endurance:jenkins:${ENVIRONMENT} | tee report"
def report = readFile "report"
def update = report.substring(report.indexOf('<html>'), report.indexOf('</html>'))
writeFile file: "${workspace}/endurance-tests.html", text: update
sh "rm report"
}
}
}