Allow pushing newly build containers to registry

This commit is contained in:
Tobias Manske 2023-06-07 20:23:26 +02:00
parent f7eb4fa46d
commit ac11f3e4f3
Signed by: tobias
GPG Key ID: 9164B527694A0709
2 changed files with 7 additions and 1 deletions

View File

@ -6,3 +6,4 @@ state: present # or running, build, absent
execute: smart # or always or never
disable_template: false
docker_profiles: []
docker_push: false # only works with build currently

View File

@ -6,11 +6,16 @@
community.docker.docker_compose:
project_src: "{{ service_dir | mandatory }}"
state: present
restarted: true
restarted: false
recreate: smart
build: true
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