Skip to content

Commit

Permalink
run script wit -e
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Jun 2, 2016
1 parent a9d458b commit cf78b91
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions install-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# FROM jenkins
# RUN install-plugins.sh docker-slaves github-branch-source

set -e

REF=${REF:-/usr/share/jenkins/ref/plugins}
mkdir -p "$REF"
Expand All @@ -17,15 +18,15 @@ function download() {
local url="${JENKINS_UC}/latest/${plugin}.hpi"
echo "download plugin : $plugin from $url"

curl -s -f -L "$url" -o "${plugin}.hpi"
if [[ $? -ne 0 ]]
if ! curl -s -f -L "$url" -o "${plugin}.hpi"
then
# some plugin don't follow the rules about artifact ID
# typically: docker-plugin
local url="${JENKINS_UC}/latest/${plugin}-plugin.hpi"
plugin=${plugin}-plugin

local url="${JENKINS_UC}/latest/${plugin}.hpi"
echo "download plugin : $plugin from $url"
curl -s -f -L "${url}" -o "${plugin}.hpi"
if [[ $? -ne 0 ]]
if ! curl -s -f -L "${url}" -o "${plugin}.hpi"
then
>&2 echo "failed to download plugin ${plugin}"
exit -1
Expand Down

0 comments on commit cf78b91

Please sign in to comment.