diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 56 |
1 files changed, 28 insertions, 28 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | # Deploy - VPS Deployment CLI | 1 | # Ship - VPS Deployment CLI |
| 2 | 2 | ||
| 3 | Simple CLI tool for deploying Go apps and static sites to a VPS with automatic HTTPS via Caddy. | 3 | Simple CLI tool for deploying Go apps and static sites to a VPS with automatic HTTPS via Caddy. |
| 4 | 4 | ||
| @@ -17,10 +17,10 @@ Simple CLI tool for deploying Go apps and static sites to a VPS with automatic H | |||
| 17 | 17 | ||
| 18 | ```bash | 18 | ```bash |
| 19 | # Build the CLI | 19 | # Build the CLI |
| 20 | go build -o ~/bin/deploy ./cmd/deploy | 20 | go build -o ~/bin/ship ./cmd/ship |
| 21 | 21 | ||
| 22 | # Or install to GOPATH | 22 | # Or install to GOPATH |
| 23 | go install ./cmd/deploy | 23 | go install ./cmd/ship |
| 24 | ``` | 24 | ``` |
| 25 | 25 | ||
| 26 | ## Quick Start | 26 | ## Quick Start |
| @@ -29,7 +29,7 @@ go install ./cmd/deploy | |||
| 29 | 29 | ||
| 30 | ```bash | 30 | ```bash |
| 31 | # Initialize a fresh VPS (this sets it as the default host) | 31 | # Initialize a fresh VPS (this sets it as the default host) |
| 32 | deploy host init user@your-vps-ip | 32 | ship host init user@your-vps-ip |
| 33 | ``` | 33 | ``` |
| 34 | 34 | ||
| 35 | This will: | 35 | This will: |
| @@ -45,15 +45,15 @@ This will: | |||
| 45 | GOOS=linux GOARCH=amd64 go build -o myapp | 45 | GOOS=linux GOARCH=amd64 go build -o myapp |
| 46 | 46 | ||
| 47 | # Deploy it | 47 | # Deploy it |
| 48 | deploy --binary ./myapp --domain api.example.com | 48 | ship --binary ./myapp --domain api.example.com |
| 49 | 49 | ||
| 50 | # With environment variables | 50 | # With environment variables |
| 51 | deploy --binary ./myapp --domain api.example.com \ | 51 | ship --binary ./myapp --domain api.example.com \ |
| 52 | --env DB_HOST=localhost \ | 52 | --env DB_HOST=localhost \ |
| 53 | --env API_KEY=secret | 53 | --env API_KEY=secret |
| 54 | 54 | ||
| 55 | # Or from an env file | 55 | # Or from an env file |
| 56 | deploy --binary ./myapp --domain api.example.com \ | 56 | ship --binary ./myapp --domain api.example.com \ |
| 57 | --env-file .env.production | 57 | --env-file .env.production |
| 58 | ``` | 58 | ``` |
| 59 | 59 | ||
| @@ -64,7 +64,7 @@ deploy --binary ./myapp --domain api.example.com \ | |||
| 64 | npm run build | 64 | npm run build |
| 65 | 65 | ||
| 66 | # Deploy it | 66 | # Deploy it |
| 67 | deploy --static --dir ./dist --domain example.com | 67 | ship --static --dir ./dist --domain example.com |
| 68 | ``` | 68 | ``` |
| 69 | 69 | ||
| 70 | ## App Requirements | 70 | ## App Requirements |
| @@ -110,72 +110,72 @@ func main() { | |||
| 110 | 110 | ||
| 111 | ```bash | 111 | ```bash |
| 112 | # Initialize a fresh VPS (one-time setup, sets as default) | 112 | # Initialize a fresh VPS (one-time setup, sets as default) |
| 113 | deploy host init user@vps-ip | 113 | ship host init user@vps-ip |
| 114 | 114 | ||
| 115 | # Update system packages (apt update && apt upgrade) | 115 | # Update system packages (apt update && apt upgrade) |
| 116 | deploy host update | 116 | ship host update |
| 117 | 117 | ||
| 118 | # Check host status | 118 | # Check host status |
| 119 | deploy host status | 119 | ship host status |
| 120 | 120 | ||
| 121 | # SSH into the host | 121 | # SSH into the host |
| 122 | deploy host ssh | 122 | ship host ssh |
| 123 | ``` | 123 | ``` |
| 124 | 124 | ||
| 125 | ### Deploy App/Site | 125 | ### Deploy App/Site |
| 126 | ```bash | 126 | ```bash |
| 127 | # Go app | 127 | # Go app |
| 128 | deploy --binary ./myapp --domain api.example.com | 128 | ship --binary ./myapp --domain api.example.com |
| 129 | 129 | ||
| 130 | # Static site | 130 | # Static site |
| 131 | deploy --static --dir ./dist --domain example.com | 131 | ship --static --dir ./dist --domain example.com |
| 132 | 132 | ||
| 133 | # Custom name (defaults to binary/directory name) | 133 | # Custom name (defaults to binary/directory name) |
| 134 | deploy --name myapi --binary ./myapp --domain api.example.com | 134 | ship --name myapi --binary ./myapp --domain api.example.com |
| 135 | ``` | 135 | ``` |
| 136 | 136 | ||
| 137 | ### List Deployments | 137 | ### List Deployments |
| 138 | ```bash | 138 | ```bash |
| 139 | deploy list | 139 | ship list |
| 140 | ``` | 140 | ``` |
| 141 | 141 | ||
| 142 | ### Manage Deployments | 142 | ### Manage Deployments |
| 143 | ```bash | 143 | ```bash |
| 144 | # View logs | 144 | # View logs |
| 145 | deploy logs myapp | 145 | ship logs myapp |
| 146 | 146 | ||
| 147 | # View status | 147 | # View status |
| 148 | deploy status myapp | 148 | ship status myapp |
| 149 | 149 | ||
| 150 | # Restart app | 150 | # Restart app |
| 151 | deploy restart myapp | 151 | ship restart myapp |
| 152 | 152 | ||
| 153 | # Remove deployment | 153 | # Remove deployment |
| 154 | deploy remove myapp | 154 | ship remove myapp |
| 155 | ``` | 155 | ``` |
| 156 | 156 | ||
| 157 | ### Environment Variables | 157 | ### Environment Variables |
| 158 | ```bash | 158 | ```bash |
| 159 | # View current env vars (secrets are masked) | 159 | # View current env vars (secrets are masked) |
| 160 | deploy env list myapi | 160 | ship env list myapi |
| 161 | 161 | ||
| 162 | # Set env vars | 162 | # Set env vars |
| 163 | deploy env set myapi DB_HOST=localhost API_KEY=secret | 163 | ship env set myapi DB_HOST=localhost API_KEY=secret |
| 164 | 164 | ||
| 165 | # Load from file | 165 | # Load from file |
| 166 | deploy env set myapi -f .env.production | 166 | ship env set myapi -f .env.production |
| 167 | 167 | ||
| 168 | # Unset env var | 168 | # Unset env var |
| 169 | deploy env unset myapi API_KEY | 169 | ship env unset myapi API_KEY |
| 170 | ``` | 170 | ``` |
| 171 | 171 | ||
| 172 | ## Configuration | 172 | ## Configuration |
| 173 | 173 | ||
| 174 | The host you initialize becomes the default, so you don't need to specify `--host` for every command. The default host is stored in `~/.config/deploy/state.json`. | 174 | The host you initialize becomes the default, so you don't need to specify `--host` for every command. The default host is stored in `~/.config/ship/state.json`. |
| 175 | 175 | ||
| 176 | ## How It Works | 176 | ## How It Works |
| 177 | 177 | ||
| 178 | 1. **State on Laptop**: All deployment state lives at `~/.config/deploy/state.json` on your laptop | 178 | 1. **State on Laptop**: All deployment state lives at `~/.config/ship/state.json` on your laptop |
| 179 | 2. **SSH Orchestration**: The CLI uses SSH to run commands on your VPS | 179 | 2. **SSH Orchestration**: The CLI uses SSH to run commands on your VPS |
| 180 | 3. **File Transfer**: Binaries transferred via SCP, static sites via rsync | 180 | 3. **File Transfer**: Binaries transferred via SCP, static sites via rsync |
| 181 | 4. **Caddy for HTTPS**: Caddy automatically handles HTTPS certificates | 181 | 4. **Caddy for HTTPS**: Caddy automatically handles HTTPS certificates |
| @@ -186,7 +186,7 @@ The host you initialize becomes the default, so you don't need to specify `--hos | |||
| 186 | 186 | ||
| 187 | ### On Laptop | 187 | ### On Laptop |
| 188 | ``` | 188 | ``` |
| 189 | ~/.config/deploy/state.json # All deployment state (including default host) | 189 | ~/.config/ship/state.json # All deployment state (including default host) |
| 190 | ``` | 190 | ``` |
| 191 | 191 | ||
| 192 | ### On VPS | 192 | ### On VPS |
| @@ -195,7 +195,7 @@ The host you initialize becomes the default, so you don't need to specify `--hos | |||
| 195 | /var/lib/myapp/ # Working directory | 195 | /var/lib/myapp/ # Working directory |
| 196 | /etc/systemd/system/myapp.service # Systemd unit | 196 | /etc/systemd/system/myapp.service # Systemd unit |
| 197 | /etc/caddy/sites-enabled/myapp.caddy # Caddy config | 197 | /etc/caddy/sites-enabled/myapp.caddy # Caddy config |
| 198 | /etc/deploy/env/myapp.env # Environment variables | 198 | /etc/ship/env/myapp.env # Environment variables |
| 199 | 199 | ||
| 200 | /var/www/mysite/ # Static site files | 200 | /var/www/mysite/ # Static site files |
| 201 | /etc/caddy/sites-enabled/mysite.caddy # Caddy config | 201 | /etc/caddy/sites-enabled/mysite.caddy # Caddy config |
