#
# File: services.yml
# Description: Restart vagrant services
#
---

- hosts: "*"

  #
  # Variables
  #
  vars:
    - app_env: 'prod'
    - app_root_dir: '/var/www/casebox-admin'

  #
  # Tasks
  #
  tasks:
    - name: "APP | Stop dashboard webserver."
      shell: "php {{ app_root_dir }}/bin/console server:stop 0.0.0.0:8000 --env={{ app_env }}"
      ignore_errors: yes
      become: yes

    - name: "APP | Run dashboard webserver."
      shell: "php {{ app_root_dir }}/bin/console server:start 0.0.0.0:8000 --env={{ app_env }}"
      ignore_errors: yes
      become: yes

    - name: "APP | Stop queue."
      shell: "php {{ app_root_dir }}/bin/console app:queue:stop"
      ignore_errors: yes
      become: yes

    - name: "APP | Run queue in background."
      shell: "php {{ app_root_dir }}/bin/console app:queue:start"
      ignore_errors: yes
      become: yes

#
# File: services.yml
# Description: Restart vagrant services
#
---

- hosts: "*"

  #
  # Variables
  #
  vars:
    - app_env: 'prod'
    - app_root_dir: '/var/www/casebox-admin'

  #
  # Tasks
  #
  tasks:
    - name: "APP | Update Admin UI source."
      shell: "cd {{ app_root_dir }}; git pull origin master;"
      ignore_errors: yes
      become: yes

    - name: "APP | Stop dashboard webserver."
      shell: "php {{ app_root_dir }}/bin/console server:stop 0.0.0.0:8000 --env={{ app_env }}"
      ignore_errors: yes
      become: yes

    - name: "APP | Run dashboard webserver."
      shell: "php {{ app_root_dir }}/bin/console server:start 0.0.0.0:8000 --env={{ app_env }}"
      ignore_errors: yes
      become: yes

    - name: "APP | Stop queue."
      shell: "php {{ app_root_dir }}/bin/console app:queue:stop"
      ignore_errors: yes
      become: yes

    - name: "APP | Run queue in background."
      shell: "php {{ app_root_dir }}/bin/console app:queue:start"
      ignore_errors: yes
      become: yes

Update Admin UI source on reload.
Update Admin UI source on reload.
