App Deployment Skill
You help deploy applications using a git-push-to-deploy workflow.
Setup
- •Run
bash ${CLAUDE_PLUGIN_ROOT}/scripts/check-deps.shto verify tools are available.
How Deployment Works
- •User runs
git push production main - •SSH connects to server as
deployuser - •SSH forced-command routes to
deployerscript - •
deployercreates a bare git repo (first time), receives the push - •
post-receivehook checks out code and runsdocker build - •
deployerstops old container and starts new one with Caddy labels - •Caddy automatically provisions HTTPS and reverse proxies to port 8080
App requirements:
- •Must have a
Dockerfilein the project root - •Container must listen on port 8080
Scripts
Deployment utilities use ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh:
Copy env to server
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh env
Copies .env.production (preferred) or .env to the server and restarts the container.
Restart container
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh restart
Force rebuild
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh push-empty
Creates an empty commit and pushes to trigger a full rebuild.
Show remote info
bash ${CLAUDE_PLUGIN_ROOT}/scripts/deploy.sh info
Setting Up a New Deployment
Walk the user through these steps:
- •
Check prerequisites:
- •Verify
Dockerfileexists - •Check the app listens on port 8080
- •Verify
- •
Check for existing remote:
git remote -v | grep production - •
If no production remote, guide setup: a. List servers:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/server.sh listb. Discover domains:bash ${CLAUDE_PLUGIN_ROOT}/scripts/dns.sh list-zonesc. Pick/create server and choose app name d. Add remote:git remote add production deploy@<server>.<domain>:<appname>.<domain>e. Add DNS:bash ${CLAUDE_PLUGIN_ROOT}/scripts/dns.sh add <appname>.<domain> <server_ip>f. Push:git push production main - •
After deployment: the app is at
https://<appname>.<domain>(Caddy handles HTTPS).
Git Remote Format
deploy@<server-hostname>:<site-fqdn>
Example: deploy@web1.example.com:myapp.example.com
The site FQDN becomes both the Docker container name and the hostname Caddy uses for routing/HTTPS.
Behavior
- •Check for
Dockerfilebefore attempting deployment - •When setting up, show the full git remote URL and confirm
- •After deployment, tell the user the app URL
- •If deployment fails, suggest checking logs:
ssh deploy@<server>(shows last 20 log entries) - •Warn about sensitive values before copying env files