Imagine you’ve just joined a data engineering team at a company that maintains multiple Python-based data pipelines and engineering projects. Excited to get started, you quickly realize that before you can even write a single line of code, you need to set up your development environment.
You spend hours creating virtual environments, upgrading pip, configuring gitignore files, and installing essential Python packages; tasks that feel repetitive and tedious for every single new project. This setup process can be very frustrating and time-consuming.
Here is how it works:
The Beejan Python Environment Bootstrapper is a Bash script that automates all these initial steps. With a single command, this Bootstrapper creates or configures a Python virtual environment, upgrades pip to the latest version, installs essential packages, configures environment files, and even writes a log of all actions - all with a single command.
It runs identically locally, in Docker, and in CI
No more repetitive setup headaches!!
The goal of this project is to practice automating repetitive Python setup tasks using bash scripting, CI/CD and Docker.
It shows how a simple bootstrap script can save time and ensure consistent environments across local, Docker, and CI workflows
setup_v1.1.sh– Main bootstrap scriptDockerfile– Docker image setupCI_pipeline.yml– GitHub Action CI/CD workflowREADME.md– Project documentation
How To Run The Script setup_v1.1.sh
There are two ways to run the Beejan Python Environment Bootstrapper: Locally or using Docker.
-
Pull docker image from docker hub
docker pull toske013/beejan-setup:v1.1 -
Run pulled docker image with an interactive bash shell session
docker run -it --rm toske013/beejan-setup:v1.1 /bin/bash -
Inspect logs (optional)
cat /vir-env/logs/setup.log
-
Clone the repository to your local machine:
git clone https://github.com/tos-in1/beejan_python_environment_bootstrapper.git -
Navigate to the directory below:
cd beejan_python_environment_bootstrapper -
Move the
setup_v1.1.shto your desired directory and makesetup_v1.1.shan executable:mv setup_v1.1.sh /path/to/directory && cd /path/to/directory chmod +x setup_v1.1.sh -
Run the setup script:
. ./setup_v1.1.sh
This project uses GitHub Actions to implement a CI/CD workflow that ensures the reliability of the setup process as the project evolves (GitHub workflow).
The pipeline:
- Validates the setup script on every push and pull request to the
mainbranch. - Builds and verifies the Docker image in a clean CI environment
- Publishes Docker images manually via workflow dispatch after successful validation
This approach allows continuous integration as the project evolves, while ensuring Docker image releases are intentionally gated for stability and controlled upgrades.
-
Add linting tests for bash scripts and dockerfile in the CI pipeline to catch erors and enforce best practices
-
Support multiple Python versions (e.g., 3.8, 3.9) for flexibility
Python, Bash, Docker, Linux, Git, GitHub Actions
