Allow for Maven Credentials to e Set Using Environment Variables #6897
honeycomb-cheesecake
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
I have never tried it but I think you can create a simple sbt plugin that sets credentials from environment variables. For example object CredPlugin extends AutoPlugin {
override def trigger = allRequirements
override def buildSettings: Seq[Def.Setting[?]] = Seq(
credentials += Credentials("my maven repo", "mymaven.host.com", sys.env("SBT_USER"), sys.env("SBT_PASS")),
)
} This plugin can be added to |
Beta Was this translation helpful? Give feedback.
1 reply
-
Related proposal: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, according to SBT Publishing, there are two ways of adding credentials, either from a file, or inline. I propose that we allow a third way of adding credentials, i.e. setting the parameters via Environment Variable(s), where you can add the name, host, username and password as 1/more variables which then get picked up during retrieve and publish. SBT already uses SBT_CREDENTIALS to set the default, so it shouldn't be a stretch to add this.
The why is simple, it would make publishing easier from an automated process. Currently, unless there's a way I don't know about and if there is PLEASE TELL ME, I echo the values to a file which is included in the build config or in .sbt/0.13/.credentials or .sbt/1.0/.credentials. It would be so much easier for them to be picked up and used directly.
Using Environment Variables would be easier than echo and more secure than inline. What do people think?
Beta Was this translation helpful? Give feedback.
All reactions