Compare commits

...

2 Commits

Author SHA1 Message Date
99714f7f86 Cleanup after 2023-12-20 13:49:10 -05:00
0bdd03bc9f Test deploy workflow with hard-coded values 2023-12-20 13:44:58 -05:00

View File

@@ -2,15 +2,37 @@
- name: Deploy BAB Frontend Application
hosts: bab1.mgmt.toal.ca
become: true
vars:
artifact_version: 0.0.2
artifact_job: 10
artifact_url: https://gitea.toal.ca/oys/bab-app/actions/runs/10/artifacts/build-artifact-{{ artifact_version }}.{{ artifact_job }}
tasks:
- name: Ensure rsync is installed on RHEL9 host
ansible.builtin.package:
name: rsync
state: present
- name: Download zip file from url
ansible.builtin.get_url:
url: "{{ artifact_url }}"
dest: /tmp/BABFrontend.zip
mode: '0644'
- name: Unzip file to temp directory
ansible.builtin.unarchive:
src: /tmp/BABFrontend.zip
dest: /tmp
remote_src: true
- name: Extract tgz file to nginx directory
ansible.builtin.unarchive:
src: /tmp/build-artifact-{{ artifact_version}}.{{ artifact_job}}/build-{{ artifact_version }}.tar.gz
dest: /usr/share/nginx/html
remote_src: true
- name: Cleanup temp directory
ansible.builtin.file:
path: /tmp/build-artifact-{{ artifact_version }}.{{ artifact_job }}
state: absent
- name: Clean up artifact download
ansible.builtin.file:
path: /tmp/BABFrontend.zip
state: absent
- name: Synchronize local directory to remote, deleting missing files
ansible.posix.synchronize:
src: '{{ bab_app_build_output_dir }}'
dest: '{{ bab_app_webroot }}'
delete: true