jenkinsci / plugin-installation-manager-tool

Plugin Manager CLI tool for Jenkins
MIT License
389 stars 202 forks source link

Add support for file:// protocol in plugin URI #365

Open intelmatt opened 3 years ago

intelmatt commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins 2.303.1; no plugins installed

Reproduction steps

  1. Run Jenkins docker LTS image
  2. Open a shell in the image
  3. Try to install a local hpi file by running this command: jenkins-plugin-cli -p git:4.8.2_CMT:file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi

Results

Expected result:

I expected to see the plugin and all of its dependencies get installed.

Actual result:

I got an error:

Unable to resolve plugin URL file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi, or download plugin git to file: URI does not specify a valid host name: file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi

I believe the problem is that jenkins-plugin-cli does not support the file:// protocol. If there is some other known way to install a local hpi file using jenkins-plugin-cli dependency resolver, let me know.

timja commented 3 years ago

There’s not currently, it needs to be hosted on a web server for now

oleg-nenashev commented 2 years ago

I think it is rather RFE than bug, but indeed it would be awesome to have it implemented

nijicompany commented 2 years ago

Hello, I want to contribute to open source and I found this project beginner friendly. Can anyone guide me to make my first contribution? Help and resources are much appreciated. Thanks in advance.

shmarsy commented 2 years ago

hello, I want to contribute in this issue.

MarkEWaite commented 2 years ago

@nijicompany and @shmarsy you'll need Apache Maven and Java 11. You'll probably want an integrated development environment (IDE) like Visual Studio Code, IntelliJ, Apache Netbeans, or Eclipse.

See https://www.jenkins.io/participate/code/ for good guidelines on ways that you can contribute with code.

If you prefer more of a step-wise tutorial, see the five part video series on modernizing a plugin.

If you prefer written rather than video, consider the "Contributing to Open Source" document.

prakrit55 commented 1 year ago

Hello there ,I want to know if the bug is still there or not, if its then what is the plugin about? Is it a git plugin to be used?

mukundsrinivasb commented 1 year ago

What I have so far

  1. Managed to set up the project and build in docker container
  2. Made some minor changes just to check if everything works like adding my name to the end of a command description
  3. Have understood that the changes have to made at the lines
    @Option(name = "--plugins", aliases = {"-p"}, usage = "List of plugins to install, separated by a space",
            handler = StringArrayOptionHandler.class)
    private String[] plugins = new String[0];

    I need help with understanding

  4. What methods talk about parsing plugins to be downloaded
krisstern commented 1 year ago

Have you tried running the command jenkins-plugin-cli -p git:4.8.2_CMT:file:///usr/share/jenkins/ref/plugins/git-4.8.2_CMT.hpi with a local hpi file called something like git-4.8.2_CMT.hpi for the example @mukundsrinivasb?

krisstern commented 1 year ago

What @prakrit55 said:

Hello there ,I want to know if the bug is still there or not, if its then what is the plugin about? Is it a git plugin to be used?

Hi @prakrit55 I believe this is still an active issue to be resovled. This plugin is used to manage plugin installations. According to the README.md:

The plugin manager downloads plugins and their dependencies into a folder so that they can be easily imported into an instance of Jenkins.

jiakuanghe commented 1 year ago

Hi, I am interested in this issue. @krisstern @MarkEWaite I would like to fix it. Does anyone already fix it? Or it still waiting for someone to fix it? Thanks.

krisstern commented 1 year ago

Hi @jiakuanghe I don't think a PR has been submitted for this issue yet, so you may go ahead and try to come up with a patch. Enjoy!

jiakuanghe commented 1 year ago

Hi @jiakuanghe I don't think a PR has been submitted for this issue yet, so you may go ahead and try to come up with a patch. Enjoy!

@krisstern I just opened a PR in https://github.com/jenkinsci/plugin-installation-manager-tool/pull/522 Would you like to help me see if it is the correct way to submit a PR? But the PR is for another issue. I will finish this issue as well. Thanks.

krisstern commented 1 year ago

@jiakuanghe Sure!

It is better to put Fixes #258 up top where you have a checklist. For the checklist checkbox, try removing the extra spaces in - [x] so you will see something like the following:

Other than that the PR looks okay to be on the surface at least.

jiakuanghe commented 1 year ago

@jiakuanghe Sure!

It is better to put Fixes #258 up top where you have a checklist. For the checklist checkbox, try removing the extra spaces in - [x] so you will see something like the following:

  • [x] Task completed

Other than that the PR looks okay to be on the surface at least.

Done. I've edited it. Thanks for letting me know.

krisstern commented 1 year ago

You are welcome @jiakuanghe!

RAHULDAS6009 commented 1 year ago

can anyone give a resource to solve this issue

itsAftabAlam commented 10 months ago

Hi, I am not able to reproduce the issue. The tool works fine. Is this issue still unresolved?