Sumo Logic's Scala-based interactive shell framework
These are the components we provide:
shellbase-core_2.13
contains everything you need to make a basic, working shellshellbase-slack_2.13
contains the necessary pieces to post your commands to Slack.
<dependency>
<groupId>com.sumologic.shellbase</groupId>
<artifactId>shellbase-core_2.13</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>com.sumologic.shellbase</groupId>
<artifactId>shellbase-slack_2.13</artifactId>
<version>5.0.1</version>
</dependency>
- help / ? - Displays a summary of available commands.
- clear - Clears the text on the screen
- exit / quit - Exits the current shell
- sleep / zzz - Sleeps for the specified duration. Can use compact time:
5m
means5 minutes
- echo - Writes output to the screen (STDOUT)
- tee - Lets you fork stdout to a file
- time - Time how long a command took
- run_script / script - Execute the specified script. Will attempt to be smart about locating
We've put together a very simple example shell that can generate random numbers.
To build project in default Scala version:
./gradlew build
To build project in any supported Scala version:
./gradlew build -PscalaVersion=2.13.10
For testing, change your consumer pom.xml
or gradle.properties
to depend on the SNAPSHOT
version generated.
Make sure, your consumer can resolve artifacts from a local repository.
This project supports multiple versions of Scala. Supported versions are listed in gradle.properties
.
supportedScalaVersions
- list of supported versions (Gradle prevents building with versions from outside this list)defaultScalaVersion
- default version of Scala used for building - can be overridden with-PscalaVersion
- Make sure you have all credentials.
- Can login as
sumoapi
https://oss.sonatype.org/index.html - Can import and verify the signing key:
gpg --import ~/Desktop/api.private.key gpg-agent --daemon touch a gpg --use-agent --sign a gpg -k
- Have nexus and signing credentials in
~/.gradle/gradle.properties
nexus_username=sumoapi nexus_password=${sumoapi_password_for_sonatype_nexus} signing.gnupg.executable=gpg signing.gnupg.keyName=${id_of_imported_sumoapi_key} signing.gnupg.passphrase=${password_for_imported_sumoapi_key}
- Can login as
- Remove
-SNAPSHOT
suffix fromversion
inbuild.gradle
- Make a release branch with Scala version and project version, ex.
shellbase-5.0.2
:export RELEASE_VERSION=shellbase-5.0.2 git checkout -b ${RELEASE_VERSION} git add build.gradle git commit -m "[release] ${RELEASE_VERSION}"
- Perform a release in selected Scala versions:
./gradlew shellbase-example:publish -PscalaVersion=2.12.20 ./gradlew shellbase-slack:publish -PscalaVersion=2.12.20 ./gradlew shellbase-core:publish -PscalaVersion=2.12.20 ./gradlew shellbase-example:publish -PscalaVersion=2.13.15 ./gradlew shellbase-slack:publish -PscalaVersion=2.13.15 ./gradlew shellbase-core:publish -PscalaVersion=2.13.15
- Go to https://oss.sonatype.org/index.html#stagingRepositories, search for com.sumologic, close and release your repo. NOTE: If you had to login, reload the URL. It doesn't take you to the right page post-login
- Update the
README.md
andCHANGELOG.md
with the new version and set upcoming snapshotversion
inbuild.gradle
, ex.5.0.3-SNAPSHOT
- Commit the change and push as a PR:
git add build.gradle README.md CHANGELOG.md git commit -m "[release] Updating version after release ${RELEASE_VERSION}" git push