lukaci / sbt-azureblob-resolver   0.10.0

GNU General Public License v3.0 only GitHub

☁️Azure BlobStorage-based resolver for sbt

Scala versions: 2.12
sbt plugins: 1.x

Sbt Azure BlobStorage resolver

Build Status GitHub tag (latest SemVer)

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

accountKey=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