diff --git a/deploy_application.yml b/deploy_application.yml deleted file mode 100644 index 4f041c7..0000000 --- a/deploy_application.yml +++ /dev/null @@ -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 - diff --git a/configure_act_runner.yml b/playbooks/configure_act_runner.yml similarity index 100% rename from configure_act_runner.yml rename to playbooks/configure_act_runner.yml diff --git a/playbooks/deploy_application.yml b/playbooks/deploy_application.yml new file mode 100644 index 0000000..dc31535 --- /dev/null +++ b/playbooks/deploy_application.yml @@ -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 diff --git a/install_appwrite.yml b/playbooks/install_appwrite.yml similarity index 100% rename from install_appwrite.yml rename to playbooks/install_appwrite.yml diff --git a/install_nginx.yml b/playbooks/install_nginx.yml similarity index 100% rename from install_nginx.yml rename to playbooks/install_nginx.yml diff --git a/provision_users.yml b/playbooks/provision_users.yml similarity index 100% rename from provision_users.yml rename to playbooks/provision_users.yml diff --git a/rulebooks/gitea_webhook.yml b/rulebooks/gitea_webhook.yml new file mode 100644 index 0000000..0eee119 --- /dev/null +++ b/rulebooks/gitea_webhook.yml @@ -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: