43 lines
1.4 KiB
YAML
43 lines
1.4 KiB
YAML
![]() |
---
|
||
|
- name: install and configure PHP8 and composer
|
||
|
hosts: host
|
||
|
|
||
|
tasks:
|
||
|
## Copy the backend project containing also the frontend
|
||
|
- name: Delete spt-item-finder before adding everything again
|
||
|
file:
|
||
|
state: absent
|
||
|
path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
|
||
|
- name: Copy the project
|
||
|
copy:
|
||
|
src: ../api/
|
||
|
dest: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
|
||
|
- name: Copy PHP .env file
|
||
|
template:
|
||
|
src: ./templates/.php-env.j2
|
||
|
dest: "{{ lookup('env', 'SPT_ITEMS_PATH') }}/.env"
|
||
|
- name: Get JS chunks name
|
||
|
shell:
|
||
|
cmd: find "{{ lookup('env', 'SPT_ITEMS_PATH') }}" -type f -name "*chunk.js" -printf "%f\n"
|
||
|
register: find_output
|
||
|
- name: Get file names from find output
|
||
|
set_fact:
|
||
|
chunk_list: "{{ find_output['stdout'].split('\n') }}"
|
||
|
- name: Copy app.blade.php file
|
||
|
template:
|
||
|
src: ./templates/app.blade.php.j2
|
||
|
dest: "{{ lookup('env', 'SPT_ITEMS_PATH') }}/resources/views/app.blade.php"
|
||
|
|
||
|
- name: Download and installs all composer libs and dependencies
|
||
|
community.general.composer:
|
||
|
command: install
|
||
|
working_dir: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
|
||
|
|
||
|
# Ensure the permissions
|
||
|
- name: Reset files permissions
|
||
|
file:
|
||
|
path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
|
||
|
owner: "{{ lookup('env', 'DEPLOYMENT_USER') }}"
|
||
|
group: www-data
|
||
|
mode: 0744
|
||
|
recurse: yes
|