Update deploy workflow to use a tar in a zip
This commit is contained in:
@@ -3,17 +3,34 @@
|
|||||||
hosts: bab1.mgmt.toal.ca
|
hosts: bab1.mgmt.toal.ca
|
||||||
become: false
|
become: false
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Create temporary directory
|
||||||
|
ansible.builtin.tempfile:
|
||||||
|
state: directory
|
||||||
|
suffix: .deploy
|
||||||
|
register: tempdir
|
||||||
|
|
||||||
- name: Download zip file from url
|
- name: Download zip file from url
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ artifact_url }}"
|
url: "{{ artifact_url }}"
|
||||||
dest: /tmp/BABFrontend.zip
|
dest: /{{ tempdir.path }}/BABFrontend.zip
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
||||||
# Temporary until this drops: https://github.com/ansible/ansible/issues/81092
|
# Temporary until this drops: https://github.com/ansible/ansible/issues/81092
|
||||||
- name: Unzip file to web dir
|
- name: Unzip downloaded file
|
||||||
ansible.builtin.command: unzip -o /tmp/BABFrontend.zip -d /usr/share/nginx/html/
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ tempdir.path }}/BABFrontend.zip"
|
||||||
|
dest: "{{ tempdir.path }}"
|
||||||
|
list_files: true
|
||||||
|
remote_src: true
|
||||||
|
register: unzip_result
|
||||||
|
|
||||||
- name: Clean up artifact download
|
- name: Extract tar into /usr/share/nginx/html/
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ unzip_result.dest }}/{{ unzip_result.files[0] }}" # We expect exactly one tar file to be in the artifact.
|
||||||
|
dest: /usr/share/nginx/html/
|
||||||
|
remote_src: true
|
||||||
|
|
||||||
|
- name: Clean up
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /tmp/BABFrontend.zip
|
path: "{{ tempdir.path }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|||||||
Reference in New Issue
Block a user