forked from jenkinsci/acceptance-test-harness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·88 lines (68 loc) · 2.15 KB
/
run.sh
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
#!/bin/bash
if [ $# -lt 2 ]; then
cat <<USAGE
Usage: $0 BROWSER JENKINS [ARGS]
The script runs dryrun tests first to discover trivial problems immediately.
It can use jenkins.war from local maven repository or download it when missing.
BROWSER: Value for BROWSER variable
JENKINS: Path to the jenkins.war, Jenkins version of one of "latest", "latest-rc", "lts" and "lts-rc"
Examples:
# Run full suite in FF against ./jenkins.war.
$ ./run firefox ./jenkins.war
# Run Ant plugin test in chrome against Jenkins 1.512.
$ ./run chrome 1.512 -Dtest=AntPluginTest
# Run full suite in FF against LTS release candidate
$ ./run firefox lts-rc
USAGE
exit -2
fi
browser=$1
war=$2
if [ ! -f $war ]; then
mirrors=http://mirrors.jenkins-ci.org
case "$war" in
"latest")
war=jenkins-latest.war
url=$mirrors/war/latest/jenkins.war
;;
"latest-rc")
war=jenkins-latest-rc.war
url=$mirrors/war-rc/latest/jenkins.war
;;
"lts")
war=jenkins-lts.war
url=$mirrors/war-stable/latest/jenkins.war
;;
"lts-rc")
war=jenkins-lts-rc.war
url=$mirrors/war-stable-rc/latest/jenkins.war
;;
esac
if [ -n "$url" ]; then
find $war -maxdepth 0 -mtime +1 -delete 2> /dev/null
if [ ! -f $war ]; then
echo "Fetching $war"
curl -sL -o $war $url
fi
fi
fi
if [ ! -f $war ] && [[ $war == *.war ]]; then
curl -sL -o jenkins.war $war && war=jenkins.war
fi
if [ ! -f $war ]; then
wardir=~/.m2/repository/org/jenkins-ci/main/jenkins-war
war=$wardir/$2/jenkins-war-$2.war
if [ ! -f $war ]; then
mvn org.apache.maven.plugins:maven-dependency-plugin:2.7:get\
-DremoteRepositories=repo.jenkins-ci.org::::http://repo.jenkins-ci.org/public/\
-Dartifact=org.jenkins-ci.main:jenkins-war:$2:war
fi
if [ ! -f $war ]; then
echo "No such jenkins.war. Available local versions:"
ls $wardir/*/jenkins-war-*.war | sed -r -e 's/.*jenkins-war-(.+)\.war/\1/'
exit -1
fi
fi
shift 2
set -x
BROWSER=$browser JENKINS_WAR=$war mvn test "$@"