Open KJTsanaktsidis opened 3 years ago
@KJTsanaktsidis, For security reasons, JFrog CLI either uses the entire configuration stored by the "jfrog config add" command or reads the entire configuration from the command flags. It intentionally doesn't read the URL from the stored configuration and the credentials from the flags. If you prefer to send the credentials as command flags, also add the --url flag. Make sure the --url flag includes the Artifactory API endpoint (which usually emds with /artifactory). The reason why mixing stored configuration and flags is blocked, is to minimize the chances of mistakenly sending the credentials of one server to another. Please let me if the above helps and that everything works for you.
Thanks @eyalbe4 - that makes sense, except the go-publish
command refuses to work without a locally stored configuration:
% jfrog rt go-publish --password "$ARTIFACTORY_API_KEY" --user "$ARTIFACTORY_USERNAME" --url "https://zdrepo.jfrog.io" v2.0.1-testing123kj
[Error] No config file was found! Before running the go command on a project for the first time, the project should be configured using the go-config command.
% jfrog rt go-config
[Error] No Artifactory servers configured. Use the 'jfrog c add' command to set the Artifactory server details.
This behaviour is actually documented in the v2 release notes: https://www.jfrog.com/confluence/display/CLI/JFrog+CLI#JFrogCLI-ListofchangesinJFrogCLIv2 although it did used to work with only command line flags as you describe in v1.
Right @KJTsanaktsidis. V2 streamlines the usage of all package managers' related commands, and now all rely on a config command to be executed before the command (jfrog rt go-config
in the case of jfrog rt go
and jfrog rt go-publish
).
V1 is still available to be installed from https://jfrog.com/getcli-legacy/
We do however recommend moving to v2 at your convenience.
Let us know if you have additional questions.
Describe the bug I'm setting up a CI pipeline that publishes Go modules to Artifactory. I would like the jfrog CLI configuration to be checked in to the repository, however I would like the artifactory credentials to be supplied only at run-time when the build is running in CI.
The help output for
jfrog rt go-publish
indicates that it supports a--user
and--password
flag for this purpose:However, they appear to to be totally ignored.
To Reproduce
So, I configured an artifactory server like so:
And then tried to publish like so. However, it does not actually attempt to authenticate to artifactory with the provided user/password arguments.
Expected behavior The provided
--user
and--password
credentials should overwrite the (nonexistant) values in the artifactory config file.Screenshots N/A
Versions
Additional context N/A