2024-04-13 12:10:28 +00:00
|
|
|
---
|
|
|
|
- name: Get {{ image.repo_name }} repo's last commit
|
|
|
|
ansible.builtin.git:
|
|
|
|
repo: "{{ image.repo_url }}"
|
|
|
|
clone: no
|
|
|
|
update: no
|
|
|
|
version: master
|
|
|
|
register: git
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: Set fact commit
|
|
|
|
set_fact:
|
|
|
|
commit: "{{ git.after[0:10] }}"
|
|
|
|
|
2024-06-06 23:58:00 +00:00
|
|
|
- debug: var=commit
|
|
|
|
|
2024-04-13 12:10:28 +00:00
|
|
|
- name: Build {{ image.name }} image
|
|
|
|
containers.podman.podman_image:
|
2024-06-08 21:29:51 +00:00
|
|
|
name: "{{ image.name }}:{{ commit }}"
|
2024-04-13 12:10:28 +00:00
|
|
|
path: "{{ image.repo_url }}"
|
|
|
|
build:
|
|
|
|
force_rm: true
|
2024-06-11 21:21:02 +00:00
|
|
|
push: "{{ image.push | default(False) | bool }}"
|
|
|
|
push_args:
|
|
|
|
dest: "{{ image.push_dest | default('') }}"
|
2024-04-13 12:10:28 +00:00
|
|
|
become: true
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: Set fact {{ image.result_var }}
|
|
|
|
set_fact:
|
|
|
|
"{{ image.result_var }}": "{{ result }}"
|