If you want to deploy this server to a DigitalOcean account, use the following instructions to configure it:
Create an API token for the deployment:
- In your DigitalOcean account, click API in the topmost menu.
- Open the Tokens tab.
- Click Generate New Token.
- Give your token a name that will describe this project and grant it both "Read" and "Write" scopes.
- Click Generate Token and copy the resulting token.
Configuring deployment:
- Copy
server/digital-ocean.keys.nix.sample
toserver/digital-ocean.keys.nix
. - Replace the
...
with your API token.
To deploy to production, you will use similar steps as deploying to VirtualBox (see the README):
- Configure
server/physical.digital-ocean.prod.nix
to your preferences. deploy/manage prod create '<server/logical.prod.nix>' '<physical.digital-ocean.prod.nix>'
DIGITAL_OCEAN_AUTH_TOKEN=<your-api-token> deploy/manage prod deploy
* Note: We need to use an environment variable to specify the API token for the time being; future versions ofnixops
will not require this.
It may take a long time to build the server and upload all the dependencies.
IMPORTANT: You must keep the deployment state in deploy/prod.nixops
up-to-date in the repository. Once you run the deploy/manage prod deploy
command above, you must commit that file and always commit it any time you do a deployment that causes it to change. The deploy/manage
script is designed to keep these state files up-to-date on every deployment so that you can be sure to have the right file in your repository. Do not allow simultaneous deployments and always use the deployment state file that actually corresponds to the state of the server.
Once you've made a deployment and committed its .nixops
file to the repository, anyone on your team can deploy who has git-crypt
access to the file. The steps are just like before:
deploy/manage prod info
(get info about the production deployment)deploy/manage prod deploy
(deploy to production)git add deploy/prod.nixops && git commit -m"Deployment"