Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install-plugins.sh for update-center changes #964

Merged
merged 3 commits into from
Aug 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions install-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ main() {
echo "Registering preinstalled plugins..."
installedPlugins="$(installedPlugins)"

# Check if there's a version-specific update center, which is the case for LTS versions
# Get the update center URL based on the jenkins version
jenkinsVersion="$(jenkinsMajorMinorVersion)"
if curl -fsL -o /dev/null "$JENKINS_UC/$jenkinsVersion"; then
JENKINS_UC_LATEST="$JENKINS_UC/$jenkinsVersion"
jenkinsUcJson=$(curl -Ls -o /dev/null -w "%{url_effective}" "${JENKINS_UC}/update-center.json?version=${jenkinsVersion}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever, but still relies on internals, specifically the directory structure inside tiered update sites and the existence of latest/ directories in them (#953).

Personally I'd prefer if we could replace that by parsing the returned JSON, but I can understand if you want to put that off.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like not parse the JSON in a shall script and replace install-plugins.sh with the plugin-installation-manager-tool, but I am not sure how feasible that is at this point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With jq it's straightforward enough, but I don't know whether that is a reasonable dependency to add here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have to add it to each image type. I would prefer to hold off and just use the new tool that we want to move to anyway.

if [ -n "${jenkinsUcJson}" ]; then
slide marked this conversation as resolved.
Show resolved Hide resolved
JENKINS_UC_LATEST=${jenkinsUcJson//update-center.json/}
echo "Using version-specific update center: $JENKINS_UC_LATEST..."
else
JENKINS_UC_LATEST=
Expand Down