forked from F5Networks/f5-openstack-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
66 lines (63 loc) · 2.17 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
#!/usr/bin/env groovy
pipeline {
agent {
docker {
label "docker"
registryUrl "https://docker-registry.pdbld.f5net.com"
image "openstack-test-agenttestrunner-prod/newton:latest"
args "-v /etc/localtime:/etc/localtime:ro" \
+ " -v /srv/mesos/trtl/results:/home/jenkins/results" \
+ " -v /srv/nfs:/testlab" \
+ " -v /var/run/docker.sock:/var/run/docker.sock" \
+ " --env-file /srv/kubernetes/infra/jenkins-worker/config/openstack-test.env" \
+ " -u jenkins"
}
}
options {
ansiColor('xterm')
timestamps()
timeout(time: 2, unit: "HOURS")
}
stages {
stage("unit"){
steps {
sh '''
if [ "${RUN_UNIT_STAGE}" = "true" ]; then
echo Running the "unit" stage.
# - run tests
systest/scripts/unit_test_run_wrapper.sh
else
echo RUN_UNIT_STAGE NOT selected.
fi
'''}
}
stage("systest") {
steps {
sh '''
# - initialize env vars
. systest/scripts/init_env.sh
# - record start of build
if [ "${DONTRECORDTRTLRESULTS}" != "true" ]; then
systest/scripts/record_build_start.sh
fi
# - setup ssh agent
eval $(ssh-agent -s)
ssh-add
# - run tests
make -C systest ${JOB_BASE_NAME}
# - record results only if it's not a smoke test
if [ "${DONTRECORDTRTLRESULTS}" != "true" ]; then
if [ -n "${JOB_BASE_NAME##*smoke*}" ]; then
systest/scripts/record_results.sh
fi
fi
'''}
}
}
post {
always {
// cleanup workspace
dir("${env.WORKSPACE}") { deleteDir() }
}
}
}