betenkowski / shellbase

Sumo Logic's Scala-based interactive shell framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codecov.io Join the chat at https://gitter.im/SumoLogic/shellbase

shellbase

Sumo Logic's Scala-based interactive shell framework

Install / Download

These are the components we provide:

  • shellbase-core contains everything you need to make a basic, working shell
  • shellbase-slack contains the necessary pieces to post your commands to Slack.
    <dependency>
      <groupId>com.sumologic.shellbase</groupId>
      <artifactId>shellbase-core</artifactId>
      <version>1.4.0</version>
    </dependency>

    <dependency>
      <groupId>com.sumologic.shellbase</groupId>
      <artifactId>shellbase-slack</artifactId>
      <version>1.4.0</version>
    </dependency>

Built-In Commands

  • 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 means 5 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

Example Shell

We've put together a very simple example shell that can generate random numbers.

[Dev] Building/testing locally

  1. Locally compile/install skipping the PGP signatures:

    ./mvnw clean install -Dgpg.skip=true
    
  2. Change your consumer pom.xml to depend on the SNAPSHOT version generated.

[Dev] How to release new version

  1. Make sure you have all credentials.
<server>
  <username>sumoapi</username>
  <password>****</password>
  <id>sonatype-nexus-staging</id>
</server>
  • Signing key:
  gpg --import ~/Desktop/api.private.key
  gpg-agent --daemon
  touch a
  gpg --use-agent --sign a

  1. ./mvnw release:prepare
  2. git clean -i and remove untracked files, besides release.properties
  3. ./mvnw release:perform (alternative git checkout HEAD~1 && ./mvnw deploy)
  4. Go to https://oss.sonatype.org/index.html#stagingRepositories, search for com.sumologic and release your repo. NOTE: If you had to login, reload the URL. It doesn't take you to the right page post-login
  5. Push your commits as PR (git push origin master:new-branch)

About

Sumo Logic's Scala-based interactive shell framework

License:Apache License 2.0


Languages

Language:Scala 100.0%