boom is a simple but opinionated command line interface providing options to emulate CI steps - either on your local development environment or on a cloud based CI provider. Currently it handles maven based projects and supporting docker commands to build, test, package a code base, generating docker images which are ready to be deployed to any cloud provider - GKE, Azure, AWS or private cloud hosted in your organization - using an orchestration provider like kubernetes of your choice.
boom is built using the Cobra, Viper package and golang
- Run
go get github.com/samirprakash/boomto install the latest version of this application
or
- Clone
github.com/samirprakash/boomto your$GOPATH - CD to the cloned repo
- Run
go install ./cmd/boom
boom assumes a few things to be in installed in your local build environment or on the remote build box, in order to execute the commands. Check that the below dependencies are satisfied.
- Install maven
- Setup maven with a valid
settings.xmlin./m2folder - Install docker
- Do a
docker loginwith your credentials
-
boom maven
- execute maven based commands
- use
boom maven -hto check options and flags
Usage: boom maven [command] Available Commands: build All in One - Validate, Compile, Clean, Unit test, Package, Code Coverage and Sonar clean Cleans up your workspace deploy Copies generated package to artifactory or nexus package Packages your compiled code in a distributable format test Executes unit tests facilitated with code coverage validate Performs a validation and checks for compilation issues verify Runs quality checks on integration test results Flags: -h, --help help for maven-
boom maven build
- validates and compiles the code base
- cleans up the workspace
- runs unit tests with JaCoCo code coverage plugin
- packages the compiled code in the output as defined in
pom.xml - runs and uploads sonar static analysis reports
-
boom maven validate
- validates and compiles the code base
-
boom maven clean
- cleans up the workspace
-
boom maven test
- provides option to selectively execute integration tests or unit tests
- with
--integration-testsor-iflag executes the tests marked with a categoryintegration-tests - with
--unit-testsor-uflag executes the tests marked with a categoryunit-tests - without any flags executes all the tests which do not have a category defined
-
boom maven package
- generates a JAR artifact from the code base
- with
--skip-testor-sflag provides an option to skip the test execution while packaging
-
boom maven verify
- verifies the integration test results
- should run after the code has been packaged and integration tests have been executed
-
boom maven deploy
- deploys artifacts to remote repository such as artifactory or nexus
- with flag
--repository-idset to the string value ofrepository-id-configured-in-pomit uploads the artifact - authentication for remote repository needs to be configured beforehand by the user
-
boom docker
- execute docker commands
- use
boom docker -hto check options and flags
Usage: boom docker [command] Available Commands: build Build docker images and push to a remote repository compose Create docker compose environment based on the docker-compose.yaml in the code base tag tag and push images to docker registry test run collection of tests using newman command line runner Flags: -h, --help help for docker-
boom docker build
- builds a docker image based on a
Dockerfile - as a default, needs to be executed from the folder which contains your
Dockerfile - pushes the built image to a remote docker registry, only if the current branch is
masterordevelop - with
--image-tagor-iflag set to the value of the tag for the image will tag the image accordingly - with
--app-typeor-tflag set to the type of service i.e. - client/service/demo - would append this value to the tag
- builds a docker image based on a
-
boom docker compose
- configures any pre-requisites required for spinning up the docker containers
--repo-nameor-rcan be used to clone theconfig-sourcerepo locally by providing the repository name as an entry to this flag- spins up a docker compose environment based on the provided docker compose file as a entry for the flag
--compose-fileor-f - checks the health status of the docker containers based on the ports that have been exposed which can be provided to the command as a comma seperated string i.e.
9090,9091,9092......9099to the flag--helthcheck-portsor-p
-
boom docker clean
- stops any containers currentnly running which were started by the docker compose command
- cleans up the stopped containers from docker environment providing a clean build environment
-
boom docker test
- executes newman tests on the docker compose environment
- with flag
--network-bridgeor-nset to the default network for this compose environment. This value can be found out usingdocker network ls - with the flag
--test-collectionor-cset to the test collection - with the flag
--environment-specor-eset to the container environment
-
boom docker tag
- tags and pushes the images generated by the docker compose environment to a remote docker registry
- with flag
--current-imageor-iset to the current image which needs to be tagged as per remote docker registry requirements - with flag
--new-imageor-nset to the new tag that we want to the tag the image with
