lukaci / sbt-azureblob-resolver

☁️Azure BlobStorage-based resolver for sbt

GitHub

Sbt Azure BlobStorage resolver

Build Status

Plugin to ease resolving dependencies from and publish to Azure BlobStorage containers, using custom url syntax blob:// (default).

Thanks to ohnosequences gkatzioura frugalmechanic for the job done on other storage providers

SBT 1.1+ Support

SBT 1.1 support is available using version >= 0.10.0:

addSbtPlugin("io.github.lukaci" %% "sbt-azureblob-resolver" % "0.10.0")

Examples

Resolving

Maven Style:

resolvers += "Blob Snapshots" at "blob://youraccountname/snapshots"

Ivy Style:

resolvers += Resolver.url("Blob Snapshots", url("blob://youraccountname/snapshots"))(Resolver.ivyStylePatterns)

Publishing

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))

Valid blob:// URL Formats

blob://[ACCOUNTNAME]/[ROOT_CONTAINER]

Usage

Add this to your project/plugins.sbt file:

addSbtPlugin("io.github.lukaci" %% "sbt-azureblob-resolver" % "0.10.0")

Azure BlobStorage Credentials

Credentials are checked in

  1. Environment Variable
  2. Specific account name property files

Environment Variable

BLOB_CREDENTIALS=<ACCOUNT_NAME_1>:<SECRET_KEY_1>:<ACCOUNT_NAME_2>:<SECRET_KEY_2>:...

Specific Property Files

.<account_name>.blob-credentials

containing

accessKeyId=XXXXXX

Custom Credentials

If the default credential providers are not enough for you you can specify your own CredentialsProvider using the blobCredentialsProvider SettingKey in your build.sbt file:

blobCredentialsProvider := { (accountName: String) =>
   ...
   AzureBlobStorageCredentials(name = accountName, key = "YYYY")
}

Authors

lukaci (GitHub)

License

GNU General Public License, Version 3.0