Easily Manage Your Build Environments With the Condo [Snippets]
Easily manage your build environments with The Condo, a simple bash script that wraps all the necessary Docker commands you need into four simple commands.
Join the DZone community and get the full member experience.Join For Free
Have you come across situations where your build tools suddenly stop working after you update the operating system? Do you want a simple way of setting up your build environment each time you change or format your machine?
One option is to use Docker-based build environments. In this approach, you can create Docker images with the necessary build tools and dependencies. However, you will still have to remember the tags, mount your source code manually, and execute Docker commands with multiple arguments each time. This approach is right but needs some effort.
To address the issues in the approach mentioned above, The Condo was developed. The Condo is a simple bash script that wraps all the necessary docker commands you need to manage your build environments.
You can install Condo by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jsdjayanga/condo/main/scripts/install.sh)"
The following are four simple commands that the Condo supports.
List build environments:
Run a build environment. condo <build-env-name>:
Stop a build environment. condo stop <build-env-name>:
condo stop devj11
Clean a build environment. condo clean <build-env-name>:
condo clean devj11
The configuration file (~/.condo/condo.json) allows storing all the necessary information to run the respective Docker images, hence allowing you to run the Docker image with just the name of the environment.
You can configure and add as many build environments as you like, e.g., Java, Golang, Spring, or any custom Docker image of your choice. Furthermore, the 'additional-arguments' section in the configuration allows you to provide any Docker compliant arguments to your Docker image.
Try the Condo yourself and share your experience!
Opinions expressed by DZone contributors are their own.