vela 0.25.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/bin.js +479 -353
- package/dist/bin.js.map +4 -4
- package/package.json +1 -1
- package/templates/server/provision.sh +1 -1
package/README.md
CHANGED
|
@@ -77,10 +77,13 @@ machine again. Every command takes the same selector — `-t local`, `-t product
|
|
|
77
77
|
vela targets # what exists, and where
|
|
78
78
|
vela env set STRIPE_SECRET_KEY -t production
|
|
79
79
|
vela admin create -t production # a login for the admin panel
|
|
80
|
+
vela seeds load -t production # the records in data/seeds, where missing
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
Each deploy uploads an immutable release, runs migrations, restarts the app and health-checks it. A release that does not come up healthy is rolled back before the command exits, migrations included.
|
|
83
84
|
|
|
85
|
+
Once the release is live, the deploy loads the project's seeds (`data/seeds`) into the target's database. Seeds are the records the app needs to function, such as plans and roles, and loading only ever adds: a record whose `id` is already there is left as it is, so an edit made in the admin panel survives every later deploy and a changed seed file does not overwrite it. Each record needs an `id`, and `vela seeds save` writes them, leaving fixtures out. Read `data/seeds` before committing it, because every copy of the app gets what is in it. An account in a seed file is created with a random password for its owner to reset. A seed file the database refuses does not undo the deploy: the command exits non-zero, and `vela seeds load -t production` loads the rest once the file is fixed. Pages are prerendered before seeds load, so one that renders a record seeded for the first time shows it from the next deploy.
|
|
86
|
+
|
|
84
87
|
One deploy runs per target at a time. A second one started from another machine — CI and a laptop, say — waits for the first to finish (up to `--lock-wait` seconds, 300 by default; `0` gives up at once), and a release that is older than the one already live is dropped rather than put back in front of it. Release ids are stamped from the server's clock so every machine agrees on which is newer.
|
|
85
88
|
|
|
86
89
|
The build sees exactly what the target will run with: once a target has a database, the build renders against it over the same SSH connection (`--no-remote-db` to use a throwaway local one instead), and it runs with the target's environment rather than your `.env`. A key set only in `.env` is blanked for the build, and a `$env/static` import of one fails the deploy before anything is uploaded.
|
|
@@ -93,8 +96,8 @@ vela rollback # previous release, with its down migrations
|
|
|
93
96
|
|
|
94
97
|
`vela destroy deployment -t staging` removes a copy from its server. Its database and uploads stay behind unless you pass `--purge`, which snapshots them into `/var/lib/vela/trash` on the server (kept two weeks) before deleting. Removing production, or purging anything but a preview, asks you to type the app's name; from a script, pass `--confirm <app-name>` — `--yes` alone is not accepted for either.
|
|
95
98
|
|
|
96
|
-
These default to `production`; `vela admin`
|
|
97
|
-
the copy you are usually standing in. `vela env` has no default — see below.
|
|
99
|
+
These default to `production`; `vela admin` and `vela seeds load` default to `local`,
|
|
100
|
+
because that is the copy you are usually standing in. `vela env` has no default — see below.
|
|
98
101
|
|
|
99
102
|
## Environment
|
|
100
103
|
|