This uses the ?version= URL to determine the version specific
update center. This is the canonical way to get the version
specific update center, if one exists. Otherwise, it will
return the update center for the latest.
* Fix jenkinsci/docker/issues/861
This allows overriding the default REF dir
* Fix other references to hardcoded offset
* Fix test
* Add REF ENV item
This will make it so that REF will have a default value
* [#857] Make the jenkins.war configurable by JENKINS_WAR env property
* [#857] A final new line
* [#857] Add env variables documentation and minor fixes
* [#861] Merge documentation sections
* [#861] Format default values
* Quote to prevent word splitting, or split robustly with mapfile or read -a.
* Use variable to calculate version and fix plugins path inside .war
* Update install-plugins.sh
* Undo unrelated changes
SC1117 not fixed, but ignored, since it's been retired already in > 0.5.0,
cf. https://github.com/koalaman/shellcheck/wiki/SC1117 so I'm ignoring it
in the makefile and we'll remove it when bumping to shellcheck > 0.5.0
in the future.
`install-plugins.sh` detects failures by checking for the presence of
"$REF_DIR/failed-plugins.txt". However failed-plugins.txt was not deleted
before the script starts, so errors in a prior run will cause all future
runs to fail. This causes problems with the jenkins helm chart: since
$REF_DIR points to an emptyDir volume, failed-plugins.txt persists until
the pod is deleted or moved to another node.
Reads Jenkins version from the manifest and checks if an update center
for this version is available. If this is the case, latest plugin
versions are resolved from this update center. This ensures that
latest plugin versions are always compatible to the LTS version if
an LTS version is used.
Fixes#494
The new install-plugins.sh script removed the possibility to pass a file
containing a list of plugins that was given with the 'old' plugins.sh
script, although this functionality can be provided with only a few
lines more.
Now, when the install-plugins.sh script is called with only a single
argument that matches an existing file on the file system, it is assumed
that this file contains the list of plugins that should be installed,
newlines are replaced by spaces and this manipulated content is used as
the plugins list for further processing.
- Use modern `$()` syntax vs backticks [see [SC2006](https://github.com/koalaman/shellcheck/wiki/SC2006)]
- Always check for, and bail on, failures of `cd`. [see [SC2164](https://github.com/koalaman/shellcheck/wiki/SC2164)]
- Avoid `for foo in $(...)`, per [DontReadLinesWithFor](http://mywiki.wooledge.org/DontReadLinesWithFor)
- Avoid parsing `ls` to find subdirectories when `for d in "$dir"/*/` does the job; see also [ParsingLs](http://mywiki.wooledge.org/ParsingLs)
- `\s` is not specified in POSIX ERE (thus, not guaranteed to be available in bash-native regexes unless local platform's C library's regex implementation extends standard); use `[[:space:]]` instead.
- Avoid unnecessary deviations from POSIX sh specification:
- `echo -e` violates (not just extends) POSIX, doesn't work as expected in bash compiled with `--enable-xpg-echo-default`; [POSIX specification](http://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html) suggests `printf` as replacement (see APPLICATION USAGE section).
- `function` keyword not specified in POSIX, provides no benefit over standard-compliant syntax