mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-21 22:13:45 +03:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
---
|
|
- name: Build project
|
|
hosts: host.ublue.local
|
|
gather_facts: true
|
|
pre_tasks:
|
|
- name: DEBUG - forge variables
|
|
ansible.builtin.include_role:
|
|
name: debug_forge_vars
|
|
|
|
tasks:
|
|
- name: Build and push image to registry
|
|
containers.podman.podman_image:
|
|
name: "{{ forge_git_repository_url | regex_search(__regex_search) }}"
|
|
tag: latest
|
|
path: "{{ forge_git_repository_destination }}"
|
|
build:
|
|
file: "{{ forge_container_file | default('Containerfile') }}"
|
|
format: "{{ forge_container_format | default('oci') }}"
|
|
pull: false
|
|
push: true
|
|
push_args:
|
|
dest: "{{ forge_registry_url }}"
|
|
vars:
|
|
__regex_search: (?<=/)[^/]+(?=\.git)
|
|
async: 1800
|
|
poll: 0
|
|
register: __podman_image
|
|
|
|
- name: Waiting for container build to finish
|
|
ansible.builtin.async_status:
|
|
jid: "{{ __podman_image.ansible_job_id }}"
|
|
register: __job_result
|
|
until: __job_result.finished
|
|
retries: 1800
|
|
delay: 1
|
|
|
|
- name: INFO | Status from build and push
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "{{ __job_result.actions | to_nice_yaml(indent=2) }}"
|
|
- "{{ __job_result.image | to_nice_yaml(indent=2) }}"
|