summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md56
1 files changed, 28 insertions, 28 deletions
diff --git a/README.md b/README.md
index a2253c1..4394e35 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
1# Deploy - VPS Deployment CLI 1# Ship - VPS Deployment CLI
2 2
3Simple CLI tool for deploying Go apps and static sites to a VPS with automatic HTTPS via Caddy. 3Simple 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
20go build -o ~/bin/deploy ./cmd/deploy 20go build -o ~/bin/ship ./cmd/ship
21 21
22# Or install to GOPATH 22# Or install to GOPATH
23go install ./cmd/deploy 23go 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)
32deploy host init user@your-vps-ip 32ship host init user@your-vps-ip
33``` 33```
34 34
35This will: 35This will:
@@ -45,15 +45,15 @@ This will:
45GOOS=linux GOARCH=amd64 go build -o myapp 45GOOS=linux GOARCH=amd64 go build -o myapp
46 46
47# Deploy it 47# Deploy it
48deploy --binary ./myapp --domain api.example.com 48ship --binary ./myapp --domain api.example.com
49 49
50# With environment variables 50# With environment variables
51deploy --binary ./myapp --domain api.example.com \ 51ship --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
56deploy --binary ./myapp --domain api.example.com \ 56ship --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 \
64npm run build 64npm run build
65 65
66# Deploy it 66# Deploy it
67deploy --static --dir ./dist --domain example.com 67ship --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)
113deploy host init user@vps-ip 113ship host init user@vps-ip
114 114
115# Update system packages (apt update && apt upgrade) 115# Update system packages (apt update && apt upgrade)
116deploy host update 116ship host update
117 117
118# Check host status 118# Check host status
119deploy host status 119ship host status
120 120
121# SSH into the host 121# SSH into the host
122deploy host ssh 122ship host ssh
123``` 123```
124 124
125### Deploy App/Site 125### Deploy App/Site
126```bash 126```bash
127# Go app 127# Go app
128deploy --binary ./myapp --domain api.example.com 128ship --binary ./myapp --domain api.example.com
129 129
130# Static site 130# Static site
131deploy --static --dir ./dist --domain example.com 131ship --static --dir ./dist --domain example.com
132 132
133# Custom name (defaults to binary/directory name) 133# Custom name (defaults to binary/directory name)
134deploy --name myapi --binary ./myapp --domain api.example.com 134ship --name myapi --binary ./myapp --domain api.example.com
135``` 135```
136 136
137### List Deployments 137### List Deployments
138```bash 138```bash
139deploy list 139ship list
140``` 140```
141 141
142### Manage Deployments 142### Manage Deployments
143```bash 143```bash
144# View logs 144# View logs
145deploy logs myapp 145ship logs myapp
146 146
147# View status 147# View status
148deploy status myapp 148ship status myapp
149 149
150# Restart app 150# Restart app
151deploy restart myapp 151ship restart myapp
152 152
153# Remove deployment 153# Remove deployment
154deploy remove myapp 154ship 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)
160deploy env list myapi 160ship env list myapi
161 161
162# Set env vars 162# Set env vars
163deploy env set myapi DB_HOST=localhost API_KEY=secret 163ship env set myapi DB_HOST=localhost API_KEY=secret
164 164
165# Load from file 165# Load from file
166deploy env set myapi -f .env.production 166ship env set myapi -f .env.production
167 167
168# Unset env var 168# Unset env var
169deploy env unset myapi API_KEY 169ship env unset myapi API_KEY
170``` 170```
171 171
172## Configuration 172## Configuration
173 173
174The 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`. 174The 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
1781. **State on Laptop**: All deployment state lives at `~/.config/deploy/state.json` on your laptop 1781. **State on Laptop**: All deployment state lives at `~/.config/ship/state.json` on your laptop
1792. **SSH Orchestration**: The CLI uses SSH to run commands on your VPS 1792. **SSH Orchestration**: The CLI uses SSH to run commands on your VPS
1803. **File Transfer**: Binaries transferred via SCP, static sites via rsync 1803. **File Transfer**: Binaries transferred via SCP, static sites via rsync
1814. **Caddy for HTTPS**: Caddy automatically handles HTTPS certificates 1814. **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