forked from jenkinsci/bom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep.sh
47 lines (43 loc) · 1.21 KB
/
prep.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
#!/usr/bin/env bash
set -euxo pipefail
cd "$(dirname "${0}")"
mvn clean install ${SAMPLE_PLUGIN_OPTS:-}
ALL_LINEZ=$(
echo weekly
grep -F '.x</bom>' sample-plugin/pom.xml | sed -E 's, *<bom>(.+)</bom>,\1,g' | sort -rn
)
: "${LINEZ:=$ALL_LINEZ}"
echo "${LINEZ}" >target/lines.txt
rebuild=false
for LINE in $LINEZ; do
if $rebuild; then
mvn -f sample-plugin clean package ${SAMPLE_PLUGIN_OPTS:-} "-P${LINE}"
else
rebuild=true
bash prep-pct.sh
LINE=$LINE bash prep-megawar.sh
java \
-jar target/pct.jar \
list-plugins \
--war "target/megawar-${LINE}.war" \
--output "target/plugins.txt"
fi
if [[ -n ${CI-} ]]; then
if [[ ${LINE} != weekly ]]; then
LINE=$LINE bash prep-megawar.sh
PROFILE="-P${LINE}"
fi
# TODO https://github.com/jenkinsci/maven-hpi-plugin/pull/464
mvn \
-f sample-plugin \
hpi:resolve-test-dependencies \
${SAMPLE_PLUGIN_OPTS:-} \
${PROFILE:-} \
-DoverrideWar="../target/megawar-${LINE}.war" \
-DuseUpperBounds \
-Dhpi-plugin.version=3.42-rc1409.669de6d1a_866 \
-DcommitHashes=target/commit-hashes.txt
mv sample-plugin/target/commit-hashes.txt "target/commit-hashes-${LINE}.txt"
fi
done
# produces: target/{commit-hashes-*.txt,plugins.txt,lines.txt}