Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Factor out bintray credentials to a setting key #69

Closed
wants to merge 1 commit into from

Conversation

2m
Copy link
Member

@2m 2m commented Jul 26, 2015

Also allow to provide bintray credentials via environment variable or system property. Resolves #25.

This PR also adds sbt-git plugin, which allows automatic version management depending on the latest tag in git. In addition to clean version management this is also a one step forward to tag based releases (only step required for a release is to create a tag on some commit).

@review-ninja
Copy link

ReviewNinja

* also allow to provide bintray credentials via
** environment variable
** system property
@2m 2m force-pushed the wip-#25-bintray-credentials-2m branch from 9dbae21 to 6d0c3f8 Compare August 3, 2015 09:30
@2m
Copy link
Member Author

2m commented Aug 4, 2015

In the meantime I have released bintray-sbt with the following PR merged under

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0-8-g6d0c3f8")
resolvers += Resolver.url("2m-sbt-plugin-releases", url("https://dl.bintray.com/2m/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)

so I can use tag based automatic releases from Travis CI.

@2m
Copy link
Member Author

2m commented Sep 2, 2015

@softprops what do you think could be improved, so this PR gets merged? After looking at your past discussions and at some other sbt plugins, I think I should rework this PR to leverage sbt support for credentials. WDYT?

@lossyrob
Copy link

lossyrob commented Sep 2, 2015

I'd also curious about this PR, I'd like to make a small change to reduce the warnings for missing bintray credentials, and I'd like to base it off of these changes if they are going to be merged soon.

@@ -32,6 +32,9 @@ trait BintrayKeys {
val bintrayCredentialsFile = settingKey[File](
"File containing bintray api credentials")

val bintrayCredentials = settingKey[Option[BintrayCredentials]](
"Bintray api credentials")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sbt already has a setting for managing credentials - the credentials setting. We shouldn't be introducing a new setting here when sbt already provides this, it's just frustrating because it means bintray is doing something in a different way to every other plugin that does credentials out there, and also means you usually need to define the bintray credentials twice, once for the bintray resolver to use via the standard mechanism, and the other for the bintray plugin to use via this setting.

The other advantage of using credentials is that you can add these credentials globally in ~/.sbt/0.13/global.sbt, without having to add the bintray plugin globally.

@ninjabear
Copy link

Hey @2m, what's happening with this PR?

@2m
Copy link
Member Author

2m commented May 26, 2016

This PR should not be merged, but instead changed to use the credentials key provided by sbt. I am not currently working on this, so a PR inspired by this one is very welcome.

@ninjabear
Copy link

Understood! Thanks for the update @2m

@2m
Copy link
Member Author

2m commented Sep 5, 2016

Here is my work in progress PR: https://github.com/2m/bintray-sbt/commits/wip-%2324-%2325-sbt-credentials-2m

There is quite a bit of progress there. But I got stuck when making publishTo depend on credentials key. Basically we need this: sbt/sbt#2059

@dwijnand
Copy link
Member

My workaround to use secure env vars on Travis CI is to run a script that includes:

if [[ "$TRAVIS_PULL_REQUEST" == "false"
   && "$TRAVIS_BRANCH" == "master"
   && "$TRAVIS_SECURE_ENV_VARS" == "true"
]]; then
  mkdir ~/.bintray
  cat > ~/.bintray/.credentials <<EOF
realm = Bintray API Realm
host = api.bintray.com
user = dwijnand
password = $BINTRAY_API_KEY
EOF
fi

@dwijnand
Copy link
Member

bintray-sbt doesn't use the credentials key

On Wed, 23 Nov 2016, 18:36 Schmitt Christian, notifications@github.com
wrote:

Why not use credentials += Credentials("Bintray API Realm", "
api.bintray.com", "dwijnand", sys.env.getOrElse("BINTRAY_API_KEY", ""))?


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#69 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVCIjArE-l_NQHVJEL14UUtUO0VUIDaks5rBIeggaJpZM4FgAdt
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants