Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Deployment

Aaron Gunderson edited this page Mar 23, 2018 · 7 revisions

Overview

Observatory is deployed on Digital Ocean. We currently have two servers running, a jumpbox and the web server handling requests. All access and controls should be done from the jumpbox. The jumpbox has privileges to talk to the server and is configured to manage deployments. You can ask someone with existing SSH access to get your public key on the Jumpbox. People with access:

  • Aaron
  • Kiana
  • Wes
  • Alexander

Updating Observatory

Updating the site takes two steps:

  1. Pull the latest code with git pull (or check out a commit or branch of your choice)
  2. Run ansible-playbook ./Observatory3/deploy/deploy.yml -vv

Staging

The same steps can be used to test your code on staging.rcos.io

Initializing New Hosts

  1. Launch a new Digital Ocean instance. This will be our jumpbox for Ansible
  2. Run the following command setting up a username and password and give them root privileges and make sure you can SSH in as this user by copying your public key into their SSH config. A good tutorial for this is here: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04 adduser deploy usermod -aG sudo deploy

Initializing a Jumpbox

  1. Install Ansible via apt sudo apt-add-repository ppa:ansible/ansible sudo apt-get update sudo apt-get install ansible
  2. Install the Ansible role for node via Ansible Galaxy sudo ansible-galaxy install geerlingguy.nodejs
  3. Checkout the Observatory directory

Initializing a Web Server

After setting following the generic configuration direction (Steps 1 & 2)

  1. On the jumpbox make sure /etc/ansible/hosts(?) has the a group with the new server IP address in ini format like:
[staging-rcos]
12.34.56.78
  1. Now you can run the initializing Ansible script which will install everything the webserver needs like mongo, node, nginx and more.
  • For staging: ansible-playbook ./Observatory3/deploy/initialize.yml --extra-vars="variable_host='staging-rcos' domain='DOMAIN.rcos.io'"
  • For production: ansible-playbook ./Observatory3deploy/initialize.yml -vvv -e "domain_name='rcos.io'"
  1. The web server should now be configured and you can follow the deploy directions, just make sure to keep the variable_host='staging-rcos' in the extra-vars or you will over write production.
Clone this wiki locally