Add the following to your sbt project/plugins.sbt
file:
addSbtPlugin("org.foundweekends" % "sbt-bintray-remote-cache" % "x.y.z")
Go to https://bintray.com/<your_bintray_user>/
and create a new Generic repository with the name remote-cache
.
Next, create a package within the remote-cache repo. The granularity should typically be one package for one build.
Then in your build.sbt
:
ThisBuild / bintrayRemoteCacheOrganization := "your_bintray_user or organization"
ThisBuild / bintrayRemoteCachePackage := "your_package_name"
To push remote cache, you need to provide Bintray credentials (user name and API key) using a credential file or environment variables.
- Environment variables
sbt-bintray-remote-cache will look for bintray user and pass in the environment variables BINTRAY_REMOTE_CACHE_USER
and BINTRAY_REMOTE_CACHE_PASS
. Note that these are different from sbt-bintray.
- Credentials file
sbt-bintray-remote-cache will look for a credentials file under ~/.bintray/.credentials
used to authenticate publishing requests to bintray.
From the CI machine, run
> pushRemoteCache
From the CI machine, run
> bintrayRemoteCacheCleanOld
This will remove versions older than a month, while keeping minimum 100 cache entry.