Compare commits
7 Commits
fd576bef97
...
19f498e091
| Author | SHA1 | Date | |
|---|---|---|---|
|
19f498e091
|
|||
|
6e153d16b1
|
|||
|
b905507bb8
|
|||
|
b69162d79e
|
|||
|
a8c73b569a
|
|||
|
ed1bd120e4
|
|||
|
79b2b6f28f
|
@@ -3,17 +3,34 @@
|
||||
hosts: bab1.mgmt.toal.ca
|
||||
become: false
|
||||
tasks:
|
||||
- name: Create temporary directory
|
||||
ansible.builtin.tempfile:
|
||||
state: directory
|
||||
suffix: .deploy
|
||||
register: tempdir
|
||||
|
||||
- name: Download zip file from url
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ artifact_url }}"
|
||||
dest: /tmp/BABFrontend.zip
|
||||
dest: /{{ tempdir.path }}/BABFrontend.zip
|
||||
mode: '0644'
|
||||
|
||||
# Temporary until this drops: https://github.com/ansible/ansible/issues/81092
|
||||
- name: Unzip file to web dir
|
||||
ansible.builtin.command: unzip -o /tmp/BABFrontend.zip -d /usr/share/nginx/html/
|
||||
- name: Unzip downloaded file
|
||||
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:
|
||||
path: /tmp/BABFrontend.zip
|
||||
path: "{{ tempdir.path }}"
|
||||
state: absent
|
||||
|
||||
@@ -6,18 +6,15 @@
|
||||
ansible.eda.webhook:
|
||||
port: 5000
|
||||
host: 0.0.0.0
|
||||
filters:
|
||||
- ansible.eda.dashes_to_underscores:
|
||||
rules:
|
||||
- name: Create facts
|
||||
- name: Run Template
|
||||
condition:
|
||||
all:
|
||||
- event.payload is defined
|
||||
- event.payload.artifact_url
|
||||
- event.payload.data.artifact_url is defined
|
||||
action:
|
||||
run_job_template:
|
||||
name: bab-deploy-application
|
||||
organization: OYS
|
||||
job_args:
|
||||
extra_vars:
|
||||
artifact_url: event.payload.artifact_url
|
||||
artifact_url: "{{ event.payload.data.artifact_url }}"
|
||||
|
||||
Reference in New Issue
Block a user