54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
# This playbooks basically takes a build/ directory similar to what the Gitlab
|
|
# pipelines generate and uploads those files to the desired directory
|
|
---
|
|
- hosts: mainhost
|
|
remote_user: admin
|
|
vars:
|
|
app_dir: /opt/app
|
|
tasks:
|
|
- name: Build skeleton root directory
|
|
file:
|
|
path: '{{app_dir}}'
|
|
state: directory
|
|
|
|
- name: Build skeleton css directory
|
|
file:
|
|
path: '{{app_dir}}/css'
|
|
state: directory
|
|
|
|
- name: Build skeleton js directory
|
|
file:
|
|
path: '{{app_dir}}/js'
|
|
state: directory
|
|
|
|
- name: Build skeleton static directory
|
|
file:
|
|
path: '{{app_dir}}/static'
|
|
state: directory
|
|
|
|
- name: Build skeleton templates directory
|
|
file:
|
|
path: '{{app_dir}}/templates'
|
|
state: directory
|
|
|
|
- name: Update Binary installation
|
|
copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
with_items:
|
|
- { src: ../../build/static/css/style.css, dest: '{{app_dir}}/'}
|
|
- { src: ../../build/static/js/index.js, dest: '{{app_dir}}/js/'}
|
|
- { src: ../../build/static/js/category.js, dest: '{{app_dir}}/js/'}
|
|
- { src: ../../build/static/cantfindshit.jpg, dest: '{{app_dir}}/static/'}
|
|
- { src: ../../build/static/favicon.png, dest: '{{app_dir}}/static/'}
|
|
- { src: ../../build/templates/list.html.tera, dest: '{{app_dir}}/templates/list.html.tera'}
|
|
- { src: ../../build/templates/video.html.tera, dest: '{{app_dir}}/templates/video.html.tera'}
|
|
- { src: ../../build/Rocket.toml, dest: '{{app_dir}}/'}
|
|
- { src: ../../build/server, dest: '{{app_dir}}/'}
|
|
|
|
- name: Restart web service
|
|
become: yes
|
|
become_method: sudo
|
|
service:
|
|
name: app
|
|
state: restarted |