[Nanobox] Update Nanobox Guide

- Be a little clearer about what's going on at each step.
- Give more detailed update instructions (and be smarter about selecting the "latest" tag).
- Mention the `VAPID_*_KEY` variables.
This commit is contained in:
Daniel Hunsaker 2017-11-12 15:59:03 -07:00
parent e8a18d4259
commit 4c7b2b192a
1 changed files with 30 additions and 15 deletions

View File

@ -11,29 +11,39 @@ Development
You will need Nanobox installed, along with Docker if you're on Linux (Windows You will need Nanobox installed, along with Docker if you're on Linux (Windows
and macOS can use Docker Native, but the bundled VirtualBox is more performant and macOS can use Docker Native, but the bundled VirtualBox is more performant
while the Docker team works out some filesystem speed issues). The process is while the Docker team works out some filesystem speed issues). Once Nanobox is
simple - clone the repo, set a few variables with `nanobox evar add local installed, the process is simple - clone the Mastodon repo, set a few variables
{VARIABLE}={value}` (see below on which ones need to be set), and run `nanobox with `nanobox evar add local {VARIABLE}={value}` (see below on which ones need
run` to get to a console. It will take some time to build your local dev to be set), and run `nanobox run` to get to a console. It will take some time to
environment, but once it's done, simply set up the DB using `bundle exec rake build your local dev environment, but once it's done, simply set up the DB using
db:setup` as normal, and you're off. `bundle exec rake db:setup` as normal, and you're off.
Production Production
---------- ----------
To deploy, you'll need to create an application in [your Nanobox dashboard](https://dashboard.nanobox.io/apps) To deploy, you'll need to create an application in [your Nanobox
(which requires a [Nanobox.io](https://dashboard.nanobox.io/users/register) dashboard](https://dashboard.nanobox.io/apps) (which requires a _free_
account), clone the repo (if you haven't already set up the local development [Nanobox.io](https://dashboard.nanobox.io/users/register) account), clone the
environment), set the new app as your deploy target with `nanobox remote add Mastodon repo (if you haven't already set up the local development environment),
{app-name}`, set up the variables below using either `nanobox evar add set the new app as your deploy target with `nanobox remote add {app-name}`, set
{VARIABLE}={value}` or the app's dashboard, and then run `nanobox deploy`. up the variables below using either `nanobox evar add {VARIABLE}={value}` or the
app's dashboard, and then run `nanobox deploy`. It will take a while to build
everything for deployment the first time, but the process handles itself.
Updating Updating
-------- --------
To update, simply grab the latest tagged version with `git fetch && git checkout To update in production, simply grab the latest tagged version with `git fetch &&
$(git tag | tail -n 1)`, then re-run `nanobox deploy` - Nanobox automatically git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)`, then
handles the rest. re-run `nanobox deploy` - Nanobox automatically handles the rest. Updates should
be much faster than the initial deploy, since the build should be cached on your
own computer, and only changes are sent to the server itself. Either way, you
shouldn't see any downtime while the update process runs.
For development, grab the latest tagged version using the instructions above,
then use a `nanobox run` console to perform all the upgrade steps in the Release
Notes (except for installing dependencies - the `boxfile.yml` is updated as
needed to pull those in automatically).
Environment Variables Environment Variables
--------------------- ---------------------
@ -55,6 +65,11 @@ variables:
- `OTP_SECRET` - set to a random string of characters; you can use `nanobox - `OTP_SECRET` - set to a random string of characters; you can use `nanobox
run bundle exec rake secret` to generate one run bundle exec rake secret` to generate one
- `VAPID_PUBLIC_KEY` - generated by running `nanobox run bundle exec rake
mastodon:webpush:generate_vapid_key`
- `VAPID_PRIVATE_KEY` - generated at the same time as `VAPID_PUBLIC_KEY`
You can also set some optional values, which should override the defaults in You can also set some optional values, which should override the defaults in
`.env.nanobox`: `.env.nanobox`: