Shell script project template for XeplosionGames. Managed via .forgejo — do not push directly.
- Shell 100%
| .forgejo | ||
| ISSUE_TEMPLATE | ||
| scripts | ||
| .editorconfig | ||
| .gitignore | ||
| pull_request_template.md | ||
| README.md | ||
| xegames.config.yml | ||
template-script
Template for XeplosionGames infrastructure, configuration, and script-based service repos. Use this for nginx configs, systemctl services, Docker compose deployments, and any repo where the primary artifact is configuration or shell scripts rather than compiled code.
Creating a repo from this template
- Click Use this template on Forgejo
- Name your repo using the
node-prefix for VPS services orhub-prefix for hub services (e.g.node-nginx,hub-zulip) - Follow the setup checklist below
Setup checklist
- Set
DEPLOY_TARGETsecret (vpsorhub) in Settings → Secrets - Set
RELEASE_TOKENsecret in Settings → Secrets - Fill in
xegames.config.yml— setdeploy.targetandhealthcheck.endpoint - Implement
scripts/validate.shfor your service - Implement
scripts/service-start.shfor your service - Implement
scripts/healthcheck.shif this is an HTTP service - Update cron expression in
.forgejo/workflows/healthcheck.ymlto matchhealthcheck.interval - Clone repo on target server as
cicduser - Add sudoers entry on target server if systemctl access is needed
- Run
create-project.shfromXeplosionGames/.forgejoto seed project board - Push to
mainand verify CI passes - Enable
notify.zulip: trueonce service is stable
Code style
Shell scripts in this repo use the following conventions:
- Indent with 2 spaces
- Always quote variables:
"$VAR"not$VAR - Always use
#!/bin/bashshebang set -euo pipefailat the top of any non-stub script
ci.format_check is currently disabled pending org-wide shell style
conventions being defined. Tracked in XeplosionGames/org.
Scripts
Each script in scripts/ is a stub. Implement the body for your service —
see the comments inside each file for examples.
| Script | Required | Called by |
|---|---|---|
service-start.sh |
✅ | deploy-production.yml, deploy-test.yml, rollback.yml |
validate.sh |
✅ | ci-script.yml |
healthcheck.sh |
✅ if HTTP | All deploy workflows, healthcheck.yml |
service-stop.sh |
optional | Manual / future workflows |
build.sh |
optional | release.yml |
Workflows
| Workflow | Trigger | Purpose |
|---|---|---|
ci-script.yml |
Every push / PR | Runs scripts/validate.sh |
deploy-production.yml |
Push to main |
Deploy to production server |
deploy-test.yml |
Push to dev |
Deploy to test server (if enabled) |
rollback.yml |
Manual / auto | Roll back to a previous commit |
healthcheck.yml |
Scheduled | Periodic service health check |
release.yml |
Tag push v* |
Generate release notes + attach artifacts |
Branch structure
| Branch | Purpose |
|---|---|
main |
Production-ready, auto-deploys to production |
dev |
Active development, auto-deploys to test (if enabled) |
feature/* |
Short-lived feature branches, PR to dev or main |
hotfix/* |
Urgent fixes off main, PR to both main and dev |
Simple repos with no test environment only need main.