Closed bodgit closed 5 years ago
This relates to https://github.com/voxpupuli/puppet-blacksmith/issues/56 so we should probably find a generic way to upload artifacts. Pulp and Artifactory will probably have the same issues regarding authentication.
IMHO the whole lib/puppet_blacksmith/forge.rb
does way too much and functions are very big.
https://github.com/voxpupuli/puppet-blacksmith/pull/65 should split off most of the problematic code. I'm still VERY unhappy with the credential loading in that class, but it shouldn't be in the way too much. The next step would be to make http_url and http_headers understand Artifactory style uploads. Perhaps by introducing a forge_type variable?
Perhaps by introducing a forge_type variable?
That could work, would also allow introduction of a pulp
type too.
That could work, would also allow introduction of a pulp type too.
Would you be able to come up with a PR to introduce this? I don't have access to Artifactory so testing is hard. I'd be happy to help you come up with the changes if you get stuck.
I'll see what I can do. From the documentation the upload process is fairly simple, this is the equivalent curl
command:
curl -u username:password -X PUT http://artifactory.example.com/artifactory/local-puppet/author/module/author-module-version.tar.gz -T pkg/author-module-version.tar.gz
That's pretty much it.
I'm trying to use this module to upload to an internal Artifactory server that is configured with a forge-like repository. Currently I'm seeing two problems:
companyname-modulename
but I publish to Artifactory asusername
then it assumes the release tarball is namedusername-modulename-*.tar.gz
. This might be as simple as trusting the metadata.json rather than the credentials in the case they differ.http://artifactory.example.com/artifactory/api/puppet/local-puppet
and so blacksmith seems to be trying to log in by appending/oauth/token
to this URL which doesn't work. In the case of Artifactory, just using basic auth with the given credentials should be enough to work although it does also support using things like bearer tokens, etc. which might be nice to support.