32 lines
661 B
YAML
32 lines
661 B
YAML
---
|
|
- 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] }}"
|
|
|
|
- debug: var=commit
|
|
|
|
- name: Build {{ image.name }} image
|
|
containers.podman.podman_image:
|
|
name: "{{ image.name }}"
|
|
path: "{{ image.repo_url }}"
|
|
force: true
|
|
build:
|
|
force_rm: true
|
|
annotation:
|
|
git_commit: "{{ commit }}"
|
|
become: true
|
|
register: result
|
|
|
|
- name: Set fact {{ image.result_var }}
|
|
set_fact:
|
|
"{{ image.result_var }}": "{{ result }}"
|