Compare commits

...

11 Commits

Author SHA1 Message Date
d3e99ef12b Rearrange playbooks. Add EDA 2023-12-20 17:50:56 -05:00
39f379ae1e fix order 2023-12-20 14:47:35 -05:00
e0732bb8bd Force overwrite 2023-12-20 14:46:06 -05:00
a6dcf660b6 Temporary workaround 2023-12-20 14:33:03 -05:00
6dca08d9d8 Eighth times a charm... 2023-12-20 14:05:53 -05:00
57f65f81c9 Fix artifact URL 2023-12-20 14:04:39 -05:00
e651d2c21f FIx URL 2023-12-20 14:03:22 -05:00
37114c3eb1 Simplify process 2023-12-20 14:00:55 -05:00
1073ce1fb1 Don't need root 2023-12-20 13:55:50 -05:00
7b1fa91b41 Fix cleanup 2023-12-20 13:53:47 -05:00
c727a81986 Fix paths 2023-12-20 13:52:47 -05:00
7 changed files with 37 additions and 38 deletions

View File

@@ -1,38 +0,0 @@
---
- 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: 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

View File

@@ -0,0 +1,23 @@
---
- name: Deploy BAB Frontend Application
hosts: bab1.mgmt.toal.ca
become: false
vars:
artifact_version: 0.0.2
artifact_job: 11
artifact_url: https://gitea.toal.ca/oys/bab-app/actions/runs/{{ artifact_job }}/artifacts/build-artifact-{{ artifact_version }}.{{ artifact_job }}
tasks:
- name: Download zip file from url
ansible.builtin.get_url:
url: "{{ artifact_url }}"
dest: /tmp/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: Clean up artifact download
ansible.builtin.file:
path: /tmp/BABFrontend.zip
state: absent

View File

@@ -0,0 +1,14 @@
---
- name: Listen for Gitea Webhooks
hosts: all
sources:
- name: Ansible webhook listener
ansible.eda.webhook:
port: 5000
host: 0.0.0.0
rules:
- name: Show payload
condition: 1 == 1
action:
debug: