Runs artifact-cli inside sbt, manages all-in-one jar/zip artifacts in S3.
pip install artifact-cli
Requires Python
and pip
. (may need sudo
)
- project/plugins.sbt
addSbtPlugin("jp.ne.opt" % "sbt-art" % "0.1.3")
- ~/.artifact-cli.conf (prior) or project/artifact-cli.conf
Load ~/.artifact-cli.conf if it exists, otherwise load project/artifact-cli.conf.
[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bucket = your-bucket-name
region = your-region (e.g. ap-northeast-1, us-east-1)
First, import keys in your build.sbt
or project/Build.scala
.
import jp.ne.opt.sbtart.SbtArtPlugin.autoImport._
Group ID for artifact-cli. Default is same as your organization
.
artGroupId in art := "your-group-id"
Target file for uploading and showing information.
If your project is using sbt assembly
or play dist
to publish, you can write the nifty way as follows.
- For sbt-assembly project
import sbtassembly.AssemblyKeys._
artTarget in art := (assembly in assembly).value
Note:
artTarget in art := (assemblyOutputPath in assembly).value
also works. (without runningassembly
task)
- For play project with universal (zip-file) distribution
import com.typesafe.sbt.SbtNativePackager.Universal
artTarget in art := (packageBin in Universal).value
Path to the configuration file for artifact-cli is also customizable. Default is ~/.artifact-cli.conf
or project/artifact-cli.conf
.
artConfig in art := new File("path/to/your.conf")
Use environment variable to specify configuration file.
artConfig in art := sys.env.get("VARNAME").map(new File(_)).getOrElse((artConfig in art).value)
You can run the following tasks in the sbt project.
Task | Description | Notes |
---|---|---|
art-version |
Prints the version number of artifact-cli. | |
art-list |
Lists all the artifacts in the group. | |
art-info [REVISION] |
Shows the information of the specified artifact. | If REVISION is not set, prints the latest revision.If artTarget is not set, this task will be skipped. |
art-upload |
Uploads the current artifact. | If artTarget is not set, this task will be skipped. |