All Projects → bbstilson → sbt-codeartifact

bbstilson / sbt-codeartifact

Licence: MIT License
An sbt plugin for publishing packages to AWS CodeArtifact.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to sbt-codeartifact

sbt-rewarn
Make sbt always display compilation warnings, even for unchanged files.
Stars: ✭ 42 (+180%)
Mutual labels:  sbt-plugin
playwarts
WartRemover warts for Play Framework.
Stars: ✭ 23 (+53.33%)
Mutual labels:  sbt-plugin
sbt-elm
Scala Build Tool (SBT) plugin for the Elm programming language
Stars: ✭ 44 (+193.33%)
Mutual labels:  sbt-plugin
sbt-travisci
An sbt plugin to integrate with Travis CI
Stars: ✭ 44 (+193.33%)
Mutual labels:  sbt-plugin
sbt-guardrail
Principled code generation from OpenAPI specifications
Stars: ✭ 24 (+60%)
Mutual labels:  sbt-plugin
sbt-ethereum
An sbt-based solidity / scala development environment, and general command-line power tool, for Ethereum.
Stars: ✭ 97 (+546.67%)
Mutual labels:  sbt-plugin
gatling-sbt-plugin
Gatling Plugin for SBT
Stars: ✭ 105 (+600%)
Mutual labels:  sbt-plugin
sbt-ecr
An SBT plugin for managing Docker images within Amazon ECR.
Stars: ✭ 52 (+246.67%)
Mutual labels:  sbt-plugin
xsbt-webstart
A Webstart plugin for sbt
Stars: ✭ 12 (-20%)
Mutual labels:  sbt-plugin
sbt-kubeyml
Sbt plugin to help deploy Scala applications to Kubernetes
Stars: ✭ 37 (+146.67%)
Mutual labels:  sbt-plugin
sbt-project-switcher
A sbt plugin to switch project in a snappy way⚡️
Stars: ✭ 36 (+140%)
Mutual labels:  sbt-plugin
sbt-play-npm
Integrate a Npm application with Play framework
Stars: ✭ 10 (-33.33%)
Mutual labels:  sbt-plugin
sbt-flaky
Detect flaky tests with sbt
Stars: ✭ 35 (+133.33%)
Mutual labels:  sbt-plugin
benchdb
A database and query tool for JMH benchmark results
Stars: ✭ 58 (+286.67%)
Mutual labels:  sbt-plugin
sbt-scala-js-map
A Sbt plugin that configures source mapping for Scala.js projects hosted on Github
Stars: ✭ 30 (+100%)
Mutual labels:  sbt-plugin
sbt-swagger-2
sbt plugin for generating Swagger JSON schemas during build
Stars: ✭ 13 (-13.33%)
Mutual labels:  sbt-plugin
chuckwagon
a Scala/sbt AWS Lambda Toolkit
Stars: ✭ 29 (+93.33%)
Mutual labels:  sbt-plugin
sbt-jni
SBT Plugin to ease working with JNI
Stars: ✭ 110 (+633.33%)
Mutual labels:  sbt-plugin
sbt-ammonite-classpath
Export the classpath for Ammonite and Almond
Stars: ✭ 29 (+93.33%)
Mutual labels:  sbt-plugin
sbt-example
Run Scaladoc as unit tests
Stars: ✭ 30 (+100%)
Mutual labels:  sbt-plugin

SBT CodeArtifact

Maven

An sbt plugin for publishing/consuming packages to/from AWS CodeArtifact.

Install

First, you will need a CodeArtifact repository. Then, add the following to your sbt project/plugins.sbt file:

addSbtPlugin("io.github.bbstilson" % "sbt-codeartifact" % version)

Usage

Note that when specifying sbt-codeartifact settings in project/*.scala files (as opposed to in the root build.sbt), you will need to add the following import:

import codeartifact.CodeArtifactKeys._

Publishing

CodeArtifact provides instructions on how to connect to your repository. Click "View Connection Instructions", then choose "gradle", then copy the url.

Here's an example build.sbt file that assumes a CodeArtifact repository named "private" in the "com.example" domain has been created:

organization := "com.example"

name := "library"

version := "0.1.0"

scalaVersion := "2.13.4"

codeArtifactUrl := "https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/private"

Then, to publish, run:

sbt:library> codeArtifactPublish

Consuming

A resolver for your repository is added based on the codeArtifactUrl key. You can add more repositories manually like so:

val codeArtifactUrlBase = "https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/"

codeArtifactUrl := codeArtifactUrlBase + "release"
codeArtifactResolvers := List("foo", "bar", "baz").map(repo => codeArtifactUrlBase + repo)

In sbt:

sbt:library> show resolvers
[info] * com-example/release: https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/release
[info] * com-example/foo: https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/foo
[info] * com-example/bar: https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/bar
[info] * com-example/baz: https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/baz

Credentials

Your CodeArtifact Authentication Token is fetched dynamically using the AWS Java SDK. Credentials are resolved using the DefaultCredentialsProvider.

If you would like to provide the token statically (for example, if your AWS creds are unavailable), then you can provide the token as an environment variable:

export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain domain-name --domain-owner domain-owner-id --query authorizationToken --output text --profile profile-name`

SBT Release

If you would like to use this in conjunction with sbt-release, you will need to override the default release process; specifically, the publish step:

import ReleaseTransformations._

releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runClean,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  // This is the only step that varies.
  releaseStepCommandAndRemaining("codeArtifactPublish"),
  setNextVersion,
  commitNextVersion,
  pushChanges
)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].