We save all our build packages (conda build) in our jFrog artifactory server as the compressed tar.bz2 file that can be accessed by the URL, username and password. Currently this is done by cURLUploader task shown below
- task: cURLUploader@2
displayName: Upload to TTI Artifactory
inputs:
files: '$(Build.ArtifactStagingDirectory)/$(packageName)-$(Build.BuildId).tar.bz2'
authType: 'userAndPass'
username: 'admin'
password: '123'
url: 'https://artifactory.xyz.com/abc/local/'
redirectStderr: true
One of the issues is it is hard to control the versioning. Would be nice to have some sort of Major.Minor.Patch
instead of the Build.BuildId
as part of the compressed file name. I am thinking to use UniversalPakages task to do the job. It request to save the credential in a serviceConnection. And this step faced an issue.
- task: UniversalPackages@0
inputs:
command: publish
feedsToUse: external
externalFeedCredentials: jfrogConnect # Errors appears when creating the service connection
publishDirectory: '$(Build.ArtifactStagingDirectory)'
feedsToUsePublish: external
feedPublishExternal: https://artifactory.xyz.com/abc/local/
packagePublishExternal: $(packageName)
versionOption: patch
packagePublishDescription: Upload Package to xyz-local artifactory
When I trying to create the service connection for the jFrog artifactory repo (https://artifactory.xyz-local/noarch/
)it returns the error
Failed to query service connection API: 'https://artifactory.xyz-local/noarch/api/plugins'. Error Message: 'An error occurred while sending the request.'
Update: the repo is in our private vNet, the service connection therefore has issues to access this url, I think that's the issues caused this. The question then would be how to create a service connection to access your private resources. The pipeline task is running in our private agent it is able to access the resource. (proved by the cURLUploader task)