2016-12-07 14:43:11 +01:00
|
|
|
---
|
2016-12-07 20:30:26 +01:00
|
|
|
- name: Install packages
|
|
|
|
apt: name={{ item }}
|
|
|
|
with_items:
|
|
|
|
- git
|
|
|
|
- npm
|
|
|
|
|
|
|
|
- name: Install global node packages
|
|
|
|
npm: name={{item}} global=yes
|
|
|
|
with_items:
|
|
|
|
- grunt-cli
|
|
|
|
- bower
|
|
|
|
|
|
|
|
- name: Clone repository
|
|
|
|
git: repo={{ warehost_webclient_repo }}
|
|
|
|
dest=/usr/src/warehost-client-web/
|
|
|
|
version={{warehost_webclient_version}}
|
|
|
|
force=yes
|
|
|
|
|
|
|
|
- name: Install node dependencies
|
|
|
|
npm: path=/usr/src/warehost-client-web
|
|
|
|
|
|
|
|
- name: Install bower dependencies
|
|
|
|
command: nodejs /usr/local/bin/bower install --allow-root
|
|
|
|
args:
|
|
|
|
chdir: "/usr/src/warehost-client-web"
|
|
|
|
|
|
|
|
- name: Build warehost-client-web
|
|
|
|
command: nodejs /usr/local/bin/grunt build
|
|
|
|
args:
|
|
|
|
chdir: "/usr/src/warehost-client-web"
|
|
|
|
|
|
|
|
- name: Create destination directory
|
|
|
|
file: path=/srv/http/domain/{{warehost_webclient_domain}} state=directory mode=0755 owner={{http_usr}} group={{http_grp}}
|
|
|
|
|
|
|
|
- name: Install rsync
|
|
|
|
apt: name=rsync
|
|
|
|
|
|
|
|
# does not work (https://github.com/ansible/ansible/issues/11873)
|
|
|
|
#- name: Copy generated files
|
|
|
|
# delegate_to: "{{ inventory_hostname }}"
|
|
|
|
# synchronize:
|
|
|
|
# src: /usr/src/warehost-client-web/build/
|
|
|
|
# dest: /srv/http/domain/{{warehost_webclient_domain}}/
|
|
|
|
# delete: True
|
|
|
|
|
|
|
|
- name: Copy files
|
|
|
|
command: >
|
|
|
|
rsync -a --delete
|
|
|
|
/usr/src/warehost-client-web/build/
|
|
|
|
/srv/http/domain/{{warehost_webclient_domain}}/
|
|
|
|
|
2016-12-07 14:43:11 +01:00
|
|
|
- name: Configurate caddy for warehost client web
|
|
|
|
template: src=caddy.conf dest=/etc/caddy/hosts/79-warehost_client_web.act owner={{http_usr}} mode=0644
|
|
|
|
notify: reload caddy
|