forked from eea/eea.progressbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
81 lines (71 loc) · 3.63 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
pipeline {
agent any
environment {
GIT_NAME = "eea.progressbar"
}
stages {
stage('Functional tests') {
steps {
parallel(
"WWW": {
node(label: 'docker-1.13') {
script {
try {
checkout scm
sh '''docker run -p 8080 -d --name=$BUILD_TAG-ft-www -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" eeacms/www-devel'''
sh '''docker port $BUILD_TAG-ft-www 8080/tcp > url.file;docker_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' $BUILD_TAG-ft-www); sed -i -e "s/0.0.0.0/${docker_ip}/g" url.file'''
sh '''new_url=$(cat url.file);timeout 600 wget --retry-connrefused --tries=60 --waitretry=10 -q http://${new_url}/'''
sh '''new_url=$(cat url.file);casperjs test eea/progressbar/ftests/eea/*.js --url=${new_url} --xunit=ftestsreport.xml'''
}
finally {
sh '''docker stop $BUILD_TAG-ft-www'''
sh '''docker rm -v $BUILD_TAG-ft-www'''
}
}
junit 'ftestsreport.xml'
archiveArtifacts 'screenshot_eea.png'
}
},
"KGS": {
node(label: 'docker-1.13') {
script {
try {
checkout scm
sh '''docker run -p 8080 -d --name=$BUILD_TAG-ft-kgs -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" eeacms/kgs-devel'''
sh '''docker port $BUILD_TAG-ft-kgs 8080/tcp > url.file;docker_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' $BUILD_TAG-ft-kgs); sed -i -e "s/0.0.0.0/${docker_ip}/g" url.file'''
sh '''new_url=$(cat url.file);timeout 600 wget --retry-connrefused --tries=60 --waitretry=10 -q http://${new_url}/'''
sh '''new_url=$(cat url.file);casperjs test eea/progressbar/ftests/kgs/*.js --url=${new_url} --xunit=ftestsreport.xml'''
}
finally {
sh '''docker stop $BUILD_TAG-ft-kgs'''
sh '''docker rm -v $BUILD_TAG-ft-kgs'''
}
}
junit 'ftestsreport.xml'
archiveArtifacts 'screenshot_kgs.png'
}
},
"Plone4": {
node(label: 'docker-1.13') {
script {
try {
checkout scm
sh '''docker run -p 8080 -d --name=$BUILD_TAG-ft-plone4 -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" eeacms/plone-test:4'''
sh '''docker port $BUILD_TAG-ft-plone4 8080/tcp > url.file;docker_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' $BUILD_TAG-ft-plone4); sed -i -e "s/0.0.0.0/${docker_ip}/g" url.file'''
sh '''new_url=$(cat url.file);timeout 600 wget --retry-connrefused --tries=60 --waitretry=10 -q http://${new_url}/'''
sh '''new_url=$(cat url.file);casperjs test eea/progressbar/ftests/plone4/*.js --url=${new_url} --xunit=ftestsreport.xml'''
}
finally {
sh '''docker stop $BUILD_TAG-ft-plone4'''
sh '''docker rm -v $BUILD_TAG-ft-plone4'''
}
}
junit 'ftestsreport.xml'
archiveArtifacts 'screenshot_plone4.png'
}
}
)
}
}
}
}