---
- include_tasks: utils/once/flag.yml
- name: "π§© load docker, proxy for '{{ application_id }}'"
include_role:
name: sys-stk-full
vars:
compose_handlers_flush: false
- name: "π¬ Stage the API application into the build context of '{{ application_id }}'"
stack_host_copy:
src: "python/"
dest: "{{ [API_BUILD_DIR, 'python'] | path_join }}/"
directory_mode: "0755"
notify:
- compose-build
- compose-up
- name: "π Reserve a controller file for the snapshot of '{{ application_id }}'"
ansible.builtin.tempfile:
suffix: .tar.gz
register: api_snapshot_archive
delegate_to: localhost
become: false
run_once: true
- name: "πΈ Archive the deployed working tree for '{{ application_id }}'"
ansible.builtin.shell: >-
set -o pipefail &&
tar --sort=name --mtime=@0 --owner=0 --group=0 --numeric-owner
--exclude=__pycache__ --exclude=node_modules --exclude=docs.po
-cf - {{ API_SNAPSHOT_PATHS | join(' ') }}
| gzip -n > {{ api_snapshot_archive.path | quote }}
args:
chdir: "{{ lookup('path_absolute', '.') }}"
executable: /bin/bash
delegate_to: localhost
become: false
run_once: true
changed_when: false
- name: "π¦ Stage the snapshot into the build context of '{{ application_id }}'"
stack_host_copy:
src: "{{ api_snapshot_archive.path }}"
dest: "{{ [API_BUILD_DIR, 'snapshot.tar.gz'] | path_join }}"
notify:
- compose-build
- compose-up
- name: "π§Ή Remove the controller snapshot of '{{ application_id }}'"
ansible.builtin.file:
path: "{{ api_snapshot_archive.path }}"
state: absent
delegate_to: localhost
become: false
run_once: true
- name: "πΏ Flush compose handlers for '{{ application_id }}'"
ansible.builtin.meta: flush_handlers