Fix #319 Ignore plugins bundled under detached-plugins
They are not loaded by Jenkins in new installations
diff --git a/install-plugins.sh b/install-plugins.sh
index 3567161..a83e611 100755
--- a/install-plugins.sh
+++ b/install-plugins.sh
Binary files differ
diff --git a/plugins.sh b/plugins.sh
index 726ed86..027c382 100755
--- a/plugins.sh
+++ b/plugins.sh
@@ -12,6 +12,8 @@
set -e
+echo "WARN: plugins.sh is deprecated, please switch to install-plugins.sh"
+
if [ -z "$1" ]
then
echo "
@@ -62,7 +64,7 @@
then
echo "Analyzing war: $JENKINS_WAR"
TEMP_PLUGIN_DIR=/tmp/plugintemp.$$
- for i in `jar tf $JENKINS_WAR|egrep 'plugins'|egrep -v '\/$'|sort`
+ for i in `jar tf $JENKINS_WAR | egrep '[^detached-]plugins.*\..pi' | sort`
do
rm -fr $TEMP_PLUGIN_DIR
mkdir -p $TEMP_PLUGIN_DIR
diff --git a/tests/tests.bats b/tests/tests.bats
index 7735a81..81cca41 100644
--- a/tests/tests.bats
+++ b/tests/tests.bats
@@ -66,6 +66,7 @@
@test "plugins are installed with install-plugins.sh" {
run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins
assert_success
+ refute_line --partial 'Skipping already bundled dependency'
# replace DOS line endings \r\n
run bash -c "docker run -ti --rm $SUT_IMAGE-install-plugins ls --color=never -1 /var/jenkins_home/plugins | tr -d '\r'"
assert_success
@@ -77,8 +78,14 @@
assert_line 'credentials.jpi.pinned'
assert_line 'mesos.jpi'
assert_line 'mesos.jpi.pinned'
+ # optional dependencies
refute_line 'metrics.jpi'
refute_line 'metrics.jpi.pinned'
+ # plugins bundled but under detached-plugins, so need to be installed
+ assert_line 'javadoc.jpi'
+ assert_line 'javadoc.jpi.pinned'
+ assert_line 'mailer.jpi'
+ assert_line 'mailer.jpi.pinned'
}
@test "clean test containers" {