---
# This playbook is invoked by Jenkins to build the site and rsync it out
# to each webserver.

- name: Build the site locally first.
  hosts: local
  connection: local
  tasks:

  - name: Run the build script to generate the site.
    command: ../build_site.sh

- name: Deploy content to the chosen webserver group.
  hosts: "{{ group }}"
  remote_user: publisher
  vars_files:
  - vars.yml
  roles:
  - role: content
    srcroot: ..
    foreverroot: /home/publisher/.forever

---
# This playbook is invoked by Jenkins to build the site and rsync it out
# to each webserver.

- name: Build the site locally first.
  hosts: local
  connection: local
  tasks:

  - name: Run the build script to generate the site.
    command: ../build_site.sh

  - name: Install dependencies for the CDN publisher.
    npm: path=../src/cdn_publisher/

  - name: Publish static assets to the appropriate container.
    command: chdir=../src/cdn_publisher node index.js /var/lib/jenkins/{{ env }}-config.json

- name: Deploy content to the chosen webserver group.
  hosts: "{{ group }}"
  remote_user: publisher
  vars_files:
  - vars.yml
  roles:
  - role: content
    srcroot: ..
    foreverroot: /home/publisher/.forever

Install dependencies and execute the CDN publisher.
Install dependencies and execute the CDN publisher.
