33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
---
|
|||
|
|
# Порядок важен: сначала всё, что не трогает работающий контейнер (проверки,
|
||
|
|
# обновление кода, сборка образа), и только потом замена контейнера. Если
|
||
|
|
# что-то упало до replace, старый контейнер продолжает работать.
|
||
|
|
- name: Preflight checks
|
||
|
|
ansible.builtin.import_tasks: preflight.yml
|
||
|
|
tags: [preflight]
|
||
|
|
|
||
|
|
- name: Dry run stops after preflight
|
||
|
|
ansible.builtin.debug:
|
||
|
|
msg: "check mode: git, build, replace and verify are skipped"
|
||
|
|
when: ansible_check_mode
|
||
|
|
tags: [always]
|
||
|
|
|
||
|
|
- name: Update the git clone
|
||
|
|
ansible.builtin.import_tasks: git.yml
|
||
|
|
when: not ansible_check_mode
|
||
|
|
tags: [git]
|
||
|
|
|
||
|
|
- name: Build the image
|
||
|
|
ansible.builtin.import_tasks: build.yml
|
||
|
|
when: not ansible_check_mode
|
||
|
|
tags: [build]
|
||
|
|
|
||
|
|
- name: Replace the container
|
||
|
|
ansible.builtin.import_tasks: replace.yml
|
||
|
|
when: not ansible_check_mode
|
||
|
|
tags: [replace]
|
||
|
|
|
||
|
|
- name: Verify the new container
|
||
|
|
ansible.builtin.import_tasks: verify.yml
|
||
|
|
when: not ansible_check_mode
|
||
|
|
tags: [verify]
|