Deployment

Documentation of web resources deployment configuration, including instructions for the maintenance and creation of applications.

Index

The droplet is set up to serve applications using nginx as a reverse proxy; a service that can take requests to the droplet itself and redirect them to specific services. This enables different website addresses pointing to the droplet to serve as internal addresses for locations or services on the machine. Changing nginx configuration or adding sites to /var/www require super user privileges or altered file access permissions.

Continuous Integration using a Git Hook1

Site content is owned by a dummy git user on the droplet, created to facilitate access to deployment repositories which live in their home directory. (/home/git/<sitename>.git). By convention, a symbolic link provides static site content to /var/www/<site-address.ca> from which it is served by nginx. In this way, anyone can contribute to web services from a common dummy user without requiring super user privileges.

Git repositories provide a number of event triggered scripts called “hooks”. The post-receive hook is trigged after any push to the repository, which lets us dynamically populate content or restart an updated service whenever it is changed.

Local Setup

See Wiki - Contributing for access information.

On your local development machine, you’ll need to set up a repo to push from, using the droplet as a remote.

git remote add live ssh://droplet-git/~/my-site.git

or ~/my-service.git

cd dist
git add .
git commit -m "Updates from script deployment"
git push live main

References


  1. Deploying Code with a Git Hook ↩︎