Page History
...
The js7 repository holds the source code to build for building the JS7 Controller and JS7 Agent.
...
The JS7 Controller and Agent are implemented with Scala and have to be build built with sbt (Scala Build Tool). SOS uses sbt version 1.1.5 with sbt_script version 1.4.2.
...
Determine the latest tagged version and store it to as a local variable.
Code Block | ||||
---|---|---|---|---|
| ||||
tag=$(git describe --tags `git rev-list --tags --max-count=1`) |
Checkout the latest version using the just stored variable to a local branch "latest" using the variable you have just stored.
Code Block | ||||
---|---|---|---|---|
| ||||
git checkout $tag -b latest |
...
The project will be locally built. The resulting binaries will not be published to in any repository.
Code Block | ||
---|---|---|
| ||
./sbt-batch clean-all compile |
...
This is the recommended way to build JS7 as the resulting binaries are automatically published to in a local /.m2
repository and are available for further builds (e.g. sos-components).
Code Block | ||
---|---|---|
| ||
./sbt-batch clean-all compile publishM2 |
If an already checkout checked out tag is being built again then it throws will throw the error error: java.io.IOException: PUT operation failed because the destination file exists and overwriting is disabled. To solve this error it is required necessary to clear/delete the local [USER_HOME]/.m2/repository/com/sos-berlin/js7 folder before the build.
Note: It is not required necessary to clear/delete the folder if a new tag is checked out and build for the first time.
Build and Publish to a Binary Repository
The credentials required to deploy to a binary repository have to be available from a credentials file, see https://www.scala-sbt.org/1.x/docs/Publishing.html#Credentials for more information.
Set the repository credentials and repository URI for the build to an environment variable with the name SBT_OPTS
.
...