Plugin to ease resolving dependencies from and publish to Azure BlobStorage containers, using custom url syntax 'blob://'.
This is a fork of https://github.com/lukaci/sbt-azureblob-resolver with added support for all types of credentials - original plugin supports only shared key credentials.
Thanks to ohnosequences gkatzioura frugalmechanic for the job done on other storage providers
SBT 1.1 support is available using version >= 0.10.0:
addSbtPlugin("com.valamis" %% "sbt-azureblob-resolver" % "0.10.0")Maven Style:
resolvers += "Blob Snapshots" at "blob://youraccountname/snapshots"Ivy Style:
resolvers += Resolver.url("Blob Snapshots", url("blob://youraccountname/snapshots"))(Resolver.ivyStylePatterns)Maven Style:
publishMavenStyle := true
publishTo := Some("Blob Snapshots" at "blob://youraccountname/snapshots")Ivy Style:
publishMavenStyle := false
publishTo := Some(Resolver.url("Blob Snapshots", url("blob://youraccountname/snapshots"))(Resolver.ivyStylePatterns))blob://[ACCOUNTNAME]/[ROOT_CONTAINER]
addSbtPlugin("com.valamis" %% "sbt-azureblob-resolver" % "0.10.0")Note: if you need to resolve other plugins, published to your Azure Blob storage, then you need to put addSbtPlugin
line to project/project/project/plugins.sbt file.
See here for details
Credentials are checked in
- Environment variables (token credentials first)
- Specific account name property files (token credentials first)
If no credentials found, then anonymous access is used
SBT_BLOB_TOKEN_CREDENTIALS=<ACCOUNT_NAME_1>:<SECRET_KEY_1>:<ACCOUNT_NAME_2>:<SECRET_KEY_2>:...
SBT_BLOB_SHARED_KEY_CREDENTIALS=<ACCOUNT_NAME_1>:<SECRET_KEY_1>:<ACCOUNT_NAME_2>:<SECRET_KEY_2>:...
.<account_name>.sbt-blob-token-credentials
.<account_name>.sbt-blob-shared-key-credentialscontaining
accountKey=XXXXXXIf the default credential providers are not enough for you you can specify your own CredentialsProvider using the blobCredentialsProvider SettingKey in your build.sbt file:
import com.valamis.sbt.azure.blob.resolver._
import com.microsoft.azure.storage.blob.ICredentials
...
blobCredentialsProvider := new AzureBlobStorageCredentialsProvider {
override val credentialsType: CredentialsTypes.Value = CredentialsTypes.Token
override def provide(accountName: String): Either[List[String], ICredentials] = {
// returned value should be an instance of
// - Left[List[String]] with list of errors if there is a failure
// - Right[ICredentials] if credentials are successfully provided
}
}where credentialsType should have one of these values:
object CredentialsTypes extends Enumeration {
val Token: CredentialsTypes.Value = Value("token")
val SharedKey: CredentialsTypes.Value = Value("shared-key")
val Anon: CredentialsTypes.Value = Value("anon")
val All: CredentialsTypes.Value = Value("all")
}lukaci (GitHub)
Pavel Kornilov (GitHub) - support for all types of credentials