51 lines
1 KiB
YAML
51 lines
1 KiB
YAML
---
|
|
- name: create deploy directory
|
|
file:
|
|
path: "{{ meshviewer_path }}"
|
|
state: directory
|
|
mode: 0755
|
|
owner: www-data
|
|
group: www-data
|
|
|
|
- name: clone repo
|
|
git:
|
|
repo: "https://github.com/ffrgb/meshviewer.git"
|
|
dest: "{{ meshviewer_src }}"
|
|
version: develop
|
|
force: yes
|
|
become: false
|
|
|
|
- name: install dependencies
|
|
yarn:
|
|
path: "{{ meshviewer_src }}"
|
|
become: false
|
|
|
|
- name: create meshviewer config
|
|
template:
|
|
src: config.js.j2
|
|
dest: "{{ meshviewer_src }}/config.js"
|
|
mode: 0644
|
|
owner: admin
|
|
group: admin
|
|
become: false
|
|
|
|
- name: build
|
|
shell: yarn run gulp
|
|
args:
|
|
chdir: "{{ meshviewer_src }}"
|
|
become: false
|
|
|
|
- name: deploy
|
|
shell: 'rm -rf {{ meshviewer_path }}/* && cp -ar build/* {{ meshviewer_path }} && chown www-data:www-data -R {{ meshviewer_path }}'
|
|
args:
|
|
chdir: "{{ meshviewer_src }}"
|
|
warn: no
|
|
|
|
- name: write vhost
|
|
template:
|
|
src: meshviewer_vhost.conf.j2
|
|
dest: /etc/nginx/conf.d/meshviewer.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart nginx
|