A command-line deployment utility for Go projects, written in Bash, demonstrating key CLI design principles.
In a fast-paced development environment, deploying applications needs to be a repeatable, reliable, and simple process. Manually running a sequence of commands (git pull, go build, service restart) is prone to error and inconsistency across team members. This utility was created to solve that problem by automating the entire workflow into a single, user-friendly command.
- Intuitive Flag-Based Controls: Easily modify the deployment behavior with simple flags like
--skip-gitand--build-only. - User-Friendly Feedback: Provides clear, step-by-step output so the user always knows what's happening.
- Built-in Help Command: A
--helpcommand provides instant documentation on how to use the tool. - Robust Error Handling: Gracefully handles unknown options to prevent incorrect usage.
- Zero Dependencies: Runs anywhere Bash, Git, and Go are installed.
Pro-Tip: An animated GIF here will make your project stand out immediately.
Before you begin, ensure you have the following installed:
- Clone the repository to your server or local machine:
git clone https://github.com/komangsidhiartha/simple-deploy-script.git
- Navigate to the project directory:
cd simple-deploy-script - Make the script executable:
chmod +x deploy.sh
The script is easy to use. Here are the available commands.
1. Show the help menu
./deploy.sh --help2. Run a full deployment (Fetches from git, builds binaries, and restarts the services)
./deploy.sh3. Build only (Builds the Go binaries but does not restart the services)
./deploy.sh --build-only4. Build and restart without pulling from git
(Skips the git fetch and git checkout steps)
./deploy.sh --skip-gitNote: The script uses sudo to restart services. You may be prompted for your password.
This project is licensed under the MIT License - see the LICENSE.md file for details.
