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

How does the plugin get configuration information from the JFrog CLI? #47

Closed
prestontim opened this issue Aug 9, 2023 · 4 comments · Fixed by #100
Closed

How does the plugin get configuration information from the JFrog CLI? #47

prestontim opened this issue Aug 9, 2023 · 4 comments · Fixed by #100
Labels
question Further information is requested

Comments

@prestontim
Copy link

How can we help?

I have a question about the JFrog CLI in respect to how it's integrated with Gradle. When I'm executing a GitHub Action, I am running the steps shown here:

image

My question: When I'm executing the "jf gradle" command, do I have access inside Gradle (in an extension or something) to what is set via the "--repo-deploy" switch passed to the "jf gradle-config" command? I'm trying to get access to this information for an in-house plugin that I'm currently working on.

I've launched both the JFrog CLI and Gradle with debug logging and nothing is really jumping out at me.

Thanks for your time!

@prestontim prestontim added the question Further information is requested label Aug 9, 2023
@yahavi
Copy link
Member

yahavi commented Aug 23, 2023

@prestontim,
When you use jf gradle, the JFrog CLI injects the Gradle Artifactory plugin using a Gradle init script. This plugin is responsible for gathering the publication and extracting deployment candidates. Eventually, the complete artifacts and build-info are sent for publication to Artifactory.

If you could provide more details about your goal, I could offer you a more precise answer.

@prestontim
Copy link
Author

@yahavi,
Thanks for getting back to me!

What I'm trying to accomplish is to update an existing in-house plugin that needs access to what the Artifactory plugin is using for the deployment repository. In the past (on Jenkins), we'd configured this via a custom project property (-PARTIFACTORY_REPO=<deploy repo name>). The project property is easy to get access to in our plugin code:
IMG_8363

On Github, we're using the JFrog CLI for this configuration (line 106 in the original screenshot), so I'm unsure how I can get access to this information.

Hopefully that makes a little more sense.

@yahavi
Copy link
Member

yahavi commented Aug 25, 2023

@prestontim
Appreciate you sharing the use case. I'm a bit uncertain about whether you're aiming to configure the repository key for the Gradle Artifactory plugin or if your goal is to retrieve the repository key.

From the provided screenshot, it appears that you're attempting to establish the deployment repository, distinguishing between snapshot and release. The plugin's code already handles the decision-making process for deploying to either repository, depending on the deployment path. For instance, if the path contains "-SNAPSHOT," the deployment is directed to the snapshot repository. You can check the implementation here: PublicationUtils.java#L406.

That being said, there's still a bit of fine-tuning needed before we can roll out this feature completely. You can take a look at the necessary adjustments here: yahavi@2bb4235.

Example:

publish {
  repository {
    releaseRepoKey = 'libs-release-local'
    snapshotRepoKey = 'libs-snapshot-local'
  }
}

If we were to implement this feature, would it fulfill your requirements?
Thanks!

@yahavi
Copy link
Member

yahavi commented Feb 14, 2024

@prestontim
In Gradle Artifactory plugin v5.2.0 we added the above functionality of configuring release and snapshot repositories.
Feel free to use it and share your feedback with us.

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

Successfully merging a pull request may close this issue.

2 participants