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

Unable to specify custom plugin location in the jenkins cr #296

Closed
salluvada opened this issue Mar 22, 2020 · 4 comments
Closed

Unable to specify custom plugin location in the jenkins cr #296

salluvada opened this issue Mar 22, 2020 · 4 comments
Assignees

Comments

@salluvada
Copy link

Currently, we are only able to specify plugin name and version for downloading plugins. I have come across a situation where I have a couple of plugins that need to be downloaded from a custom url location and not the jenkins UC.

It would be nice if we can specify some thing like

plugins:
# downloads from the default UC
- name: git
  version: 4.0.0    
# downloads from the user provided url. 
- name: devoptics
  version: 1.2.1
  downloadurl: https://downloadurl/devoptics.hpi   
@salluvada
Copy link
Author

I think it is possible. currently the operator must be concatenating the plugin name and the version number while passing as parameter to install-plugins.sh. If it also concatenates the userprovided url, it would work IMO.

 echo "Downloading plugins..."
    for plugin in "${plugins[@]}"; do
        local reg='^([^:]+):?([^:]+)?:?([^:]+)?:?(http.+)?'
        if [[ $plugin =~ $reg ]]; then
            local pluginId="${BASH_REMATCH[1]}"
            local version="${BASH_REMATCH[2]}"
            local lock="${BASH_REMATCH[3]}"
            local url="${BASH_REMATCH[4]}"
            download "$pluginId" "$version" "${lock:-true}" "${url}" &
        else
          echo "Skipping the line '${plugin}' as it does not look like a reference to a plugin"
        fi
    done

The below snippet is downloading the first plugin from jenkins UC and the second plugin from custom plugin location

/usr/local/bin/install-plugins.sh "cloudbees-devoptics-enabler" "devoptics:latest:https://jenkins-updates.cloudbees.com/download/plugins/devoptics/latest/devoptics.hpi"

@salluvada
Copy link
Author

hey thanks @tomaszsek

@tomaszsek
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants