jfrog-azure-devops-extension
jfrog-azure-devops-extension copied to clipboard
Output variable for generic jfrog cli task
Is your feature request related to a problem? Please describe.
This request sort of builds on #83. I happened to work with @jpreese at the time he requested it. The new generic jfrog cli task is very helpful, but not in the context I intend to use it. If someone has a larger powershell or bash script which uses the jfrog CLI to say query artifactory and then make a decision about what to download based on that query result, there's no way to do so in Azure DevOps in a way that uses the service connection provided by the artifactory extension. The generic task is restricted to just one call of jfrog rt
.
Describe the solution you'd like to see I think a simple solution may be to add an output variable to the existing jfrog cli task. This would write the output of the jfrog rt command to a variable that can be consumed in later tasks. For use cases like mine, the jfrog rt command could be used to generate a short lived access token for the selected service principal to be consumed in a later step.
Describe alternatives you've considered The initial approach I thought about was just some new generic task which lets you select the artifactory service principal, then runs whatever bash/powershell script you provide as an input. The artifactory instance url and credential would be available to the script via environment variables and would only exist in the context of that task.
I have the same issue when using the jfrog cli task to call a cURL command. There is no way to capture the return value.
I also would like to see this. I am trying to use the jfrog cli task to search whether an artifact already exists before building and uploading it. I can search for the artifact fine with the cli, but I cannot use that result in the next tasks.
Adding an output variable option for this would really be helpful. It can be similar to how certain other tasks already do it, like the Azure Resource Group Deployment task which provides (actually two) methods to set an outputVariable
.