A modern Bash wizard to automate initializing a bare Git repository on your target server, set up a secure post-receive deployment hook, and provide ready-to-use Git commands for seamless push-to-deploy workflows. Deployster works with cPanel or any modern Linux system with SSH access.
- Interactive stepper UI: Clean, colored, user-friendly prompts with progress indicators.
- Automatic resume: Detects incomplete setups and lets you resume, edit, or start over.
- Undo at each step: Type
undoat most prompts to go back to the previous step. - Multi-repo state: Tracks setup progress for multiple repositories.
- Robust input validation: Checks repository/branch names, paths, permissions, and prevents unsafe destinations (
/). - Modern logging: Verbose and/or file-based logs, with easy troubleshooting (timestamps, log levels).
- Automatic backup: Any existing Git hooks are automatically backed up before overwrite.
- Inline help: Type
hat menus for context-sensitive help. - CRLF stripping: Ensures hooks are safe from DOS line endings.
- Environment checks: Fails early with clear messages if required tools or permissions are missing.
- Clean separation: All config/state/log files are kept in
~/.deployster/. - Recovery on interrupt: Ctrl+C lets you save or discard partial progress, with proper state cleanup.
- No root required: Warns against running as root, and validates user permissions.
- Dry Run mode: Preview actions without making permanent changes (planned)
- Windows/WSL detection and warning: Warn if WSL or non-Linux detected (planned)
- Repo/deploy path overlap detection: Prevent using overlapping paths (planned)
-
Linux server (cPanel or non-cPanel) with:
- Bash 4.x+
- Git 2.11+
- SSH access (with authorized public key)
- Either
realpathorreadlink -f(for robust path handling)
-
Local Git client on your workstation
-
(Recommended)
dos2unixfor line-ending safety
Note: You must have your SSH public key added/authorized for your shell user before you can push code. You do not need it to run the Deployster wizard itself.
-
Download the script to your server (as the user you want to deploy as):
wget https://raw.githubusercontent.com/Ogooga/Deployster/master/deployster.sh chmod +x deployster.sh
-
(Optional): Copy to a folder in your PATH (e.g.
~/bin/)
./deployster.sh [-v|--verbose] [--log] [-h|--help]-v, --verboseEnable verbose (debug) output--logLog output to a file in~/.deployster/(disables verbose on-screen debug)-h, --helpShow usage and exit
The wizard will prompt you step-by-step:
-
Repository name (used for folder names and tracking; validated)
-
Resume/edit/start over if previous state detected
-
Bare repo path (default:
~/.gitrepo/<name>.git, must not be/) -
Deploy target (absolute path to your project folder; validated, must not be
/) -
Deployment strategy:
- 1: Specific branch (recommended for production)
- 2: Any branch (for dev/test)
- 3: Any branch + prune (experimental, not for production)
-
Review summary and confirm
-
Hook install & finish (existing hooks are backed up automatically)
$ ./deployster.sh-
Answer prompts (use Enter for defaults, or type
undoto go back) -
At completion, copy/paste the
git remote addcommand to your local workstation:git remote add production ssh://user@host/~/.gitrepo/myproject.git
-
Deploy with:
git push production master
- Undo: At any prompt, type
undoto go back a step - Help: At main menus, type
hfor context-sensitive info - Verbose: Use
-vfor debug output - Log: Use
--logto save a session log in~/.deployster/ - Resume: If interrupted, script will offer to resume or edit previous setup
- Edit: When resuming, you may interactively edit paths/branch before continuing
- Safe confirmation: Always see a summary before the final install; dangerous settings are flagged.
- Backups: Previous hooks are backed up with a timestamped
.bakextension - Ctrl+C Handling: On interrupt, choose to save, discard, or continue the setup (never leaves temp files behind)
- Must NOT be run as root. Script will warn and continue, but best practice is per-user setup.
- Absolute paths required for repo and deploy folder (relative paths rejected).
- Do NOT use
/as a destination. The script checks for this and will abort. - Bare repo and deploy target should not overlap. (planned, not enforced yet)
- SSH key must be authorized for your user before pushing code.
- Only tested on bash 4.x+. Should work on most Linux distros. MacOS not officially supported (due to BSD differences in some commands).
- Default branch is
master. - Windows/WSL: Not officially supported. WSL detection/warnings planned, but not currently present.
-
Clear saved state:
sed -i '/^myproject:/d' ~/.deployster/state
-
Logs: All logs are saved in
~/.deployster/if you use--log. -
Manual override: You can safely edit/delete files in
~/.deployster/if troubleshooting. -
State file format: One line per repo, with colon-separated
key=valuepairs. -
Repo root/web root: You can edit these interactively, or override defaults at setup.
-
See the installed hook: After setup, review/edit the generated
post-receivefile in your bare repo'shooks/folder.
-
Bug reports, issues, and pull requests are welcome on GitHub.
-
Please:
- Open clear issues for feature requests, bugs, or docs.
- Follow the code style and UX conventions in the script.
- Test thoroughly on non-production systems before PRs.
- Add comments and keep prompts clear!
MIT License. See LICENSE for details.
Made by Ogooga (https://ogooga.com) with ❤️ for sysadmins, developers, and teams everywhere.
For documentation, issues, and latest releases: https://github.com/Ogooga/Deployster