Skip to main content
View SourceRelease Notes

Bash Commons

Many of the scripts in this repo use a generic set of bash functions that any proper general purpose programming language would have in its core libraries. We try to approximate this experience for bash by creating our own "bash commons".

Usage

Any scripts in this repo that use the bash commons libraries will assume they have already been installed by Packer into a Docker image or Amazon Machine Image (AMI) with gruntwork-install as follows

gruntwork-install --module-name 'bash-commons' --tag 'vX.Y.Z' --repo https://github.com/gruntwork-io/terraform-aws-kafka

This will download all the bash-commons libraries to /opt/lib/github.com/gruntwork-io/terraform-aws-kafka/bash-commons.

Development

If you're modifying this repo, consider using the --branch property with gruntwork-install so that your Docker Image or AMI uses your active branch's copy of the bash-commons

export PACKAGE_ZOOKEEPER_BRANCH=<my-branch-name>
gruntwork-install --module-name 'bash-commons' --tag 'vX.Y.Z' --branch "$PACKAGE_KAFKA_BRANCH" --repo https://github.com/gruntwork-io/terraform-aws-kafka

Better yet, in your docker-compose.yml, mount the bash-commons module directory to /opt/lib/github.com/gruntwork-io/terraform-aws-kafka/bash-commons so that you will enjoy hot reload on every new run of docker-compose up!