SBT plugins to share common settings across Gatling's projects' builds.
Supports both sbt 1.x and sbt 2.x.
Common settings for OSS project in io.gatling group.
build.sbt:
inScope(Global) {
Seq(
githubPath := "gatling/my-awesome-project", // (1)
gatlingDevelopers := Seq( // (2)
GatlingDeveloper("jsmith@gatling.io", "John Smith", isGatlingCorp = false)
)
)
}
lazy val root = (project in file("."))
.enablePlugins(GatlingOssPlugin)
.settings(
name := "my-awesome-project" // (3)
)- github path for
pom.xmlSCM info - developers and contributors for
pom.xmldevelopers - artifact name
The version is computed from git tags with sbt-dynver (v prefixed tags, e.g. v1.2.3), so no version.sbt is needed.
Releases are driven by tags:
- the "Create release" workflow computes the next version with version-bump and pushes the matching
v<version>git tag - on tag push, CI runs
sbt "test; gatlingPublish"(+gatlingPublishfor a cross-built project), see Publishing a release
The purpose is internal only.
For closed source components published under the Gatling Enterprise Component License.
publish and publishSigned deploy with sbt-aether-deploy, which also uploads maven-metadata.xml, as Maven does.
Public artifacts are signed, internal ones (GatlingCorpPlugin) are not.
publishTo is computed from the kind of artifact and its version:
| Artifact | Version | Repository |
|---|---|---|
| any | snapshot | none: never published |
public (GatlingOssPlugin, GatlingEnterpriseComponentPlugin) |
x.y.z or x.y.z.w, optionally followed by -M<n> |
gatlingStagingRepository |
| any other | ending with -M<n> |
gatlingMilestonesRepository |
| any other | any other | gatlingReleasesRepository |
These repositories depend on the environment (CI, local machine...), so they all default to None and must be provided, typically by a global .sbt file (~/.sbt/1.0/ for sbt 1, ~/.config/sbt/2/ for sbt 2).
Global .sbt files do not see the keys of the build's plugins: redeclare them with the same name and type.
val gatlingStagingRepository = settingKey[Option[Resolver]]("")
val gatlingMilestonesRepository = settingKey[Option[Resolver]]("")
val gatlingReleasesRepository = settingKey[Option[Resolver]]("")
Global / gatlingStagingRepository := Some("staging" at "https://repository.example.com/maven/staging")
Global / gatlingMilestonesRepository := Some("milestones" at "https://repository.example.com/maven/milestones")
Global / gatlingReleasesRepository := Some("releases" at "https://repository.example.com/maven/releases")
credentials += Credentials("realm", "repository.example.com", "user", "password")gatlingPublish publishes the version of the current git tag, and is meant to run in CI on tag push:
- projects with
publish / skip := trueorCompile / publishArtifact := falsepublish nothing, whatever the git state - a modified working tree (tracked files) fails, and nothing is published
- if HEAD is not a release tag, nothing is published
- otherwise, it fails if the repository is not defined or on snapshot dependencies, then runs
publishSignedfor public artifacts orpublishfor internal ones
Projects without these plugins, such as aggregators, publish nothing.
This project is licensed under Apache License version 2, see LICENSE.txt.