ansible-role-docker-compose/tasks/build.yml

22 lines
545 B
YAML

---
- include_tasks: present.yml
- name: Build Service
community.docker.docker_compose_v2:
project_src: "{{ service_dir | mandatory }}"
state: present
restarted: false
recreate: smart
build: "always"
remove_orphans: true
profiles: docker_profiles
when: (compose_files.changed and execute == "smart") or execute == "always"
- name: Push compose container images
ansible.builtin.shell:
chdir: "{{ service_dir | mandatory }}"
cmd: "docker-compose push"
when: docker_push | bool
# vim: ft=yaml.ansible