---
- name: Deploy the static HTML.
  synchronize: src={{ srcroot }}/_site/ dest={{ docroot }}
               archive=yes checksum=yes delete=yes

- name: Deploy the drc-backend backend.
  synchronize: src={{ srcroot }}/src/drc-backend/ dest={{ backendroot }}
               archive=yes checksum=yes delete=yes
  notify:
  - restart the drc-backend

- name: Install drc backend dependencies.
  npm: path={{ backendroot }} production=yes
  notify:
  - restart the drc-backend

- name: Check the list of forever.js apps that are currently running.
  command: forever list
  register: forever_list
  changed_when: false

- name: Start the backend service
  command: forever start {{ foreverargs }} {{ backendroot }}/index.js
  when: "forever_list.stdout.find('{{ backendroot }}') == -1"

---
- name: Deploy the static HTML.
  synchronize: src={{ srcroot }}/_site/ dest={{ docroot }}
               archive=yes checksum=yes

- name: Deploy the drc-backend backend.
  synchronize: src={{ srcroot }}/src/drc-backend/ dest={{ backendroot }}
               archive=yes checksum=yes
  notify:
  - restart the drc-backend

- name: Install drc backend dependencies.
  npm: path={{ backendroot }} production=yes
  notify:
  - restart the drc-backend

- name: Check the list of forever.js apps that are currently running.
  command: forever list
  register: forever_list
  changed_when: false

- name: Start the backend service
  command: forever start {{ foreverargs }} {{ backendroot }}/index.js
  when: "forever_list.stdout.find('{{ backendroot }}') == -1"

Revert "Delete remote content that doesn't exist locally after build."
Revert "Delete remote content that doesn't exist locally after build."
