44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
---
|
|
- name: Push Dockerfiles to nfs share
|
|
ansible.builtin.template:
|
|
src: "{{ item.dockerfile }}"
|
|
dest: "/docker-shared/build/{{ item.name }}/Dockerfile"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
loop: "{{ images }}"
|
|
|
|
- name: Authenticate to Gitea registry
|
|
community.docker.docker_login:
|
|
registry_url: "{{ gitea_registry }}"
|
|
username: xbazzi
|
|
password: "{{ gitea_token }}"
|
|
|
|
- name: Build (versioned) images and push to Gitea
|
|
community.docker.docker_image:
|
|
build:
|
|
path: "/docker-shared/build/{{ item.name }}"
|
|
name: "{{ item.registry }}/{{ item.repository }}/{{ item.image_name }}"
|
|
tag: "{{ item.version }}-{{ item.os }}"
|
|
push: true
|
|
source: build
|
|
force_source: true
|
|
force_tag: true
|
|
timeout: 60
|
|
state: present
|
|
loop: "{{ images }}"
|
|
|
|
- name: Build (latest) images and push to Gitea
|
|
community.docker.docker_image:
|
|
build:
|
|
path: "/docker-shared/build/{{ item.name }}"
|
|
name: "{{ item.registry }}/{{ item.repository }}/{{ item.image_name }}"
|
|
tag: "latest"
|
|
push: true
|
|
source: build
|
|
force_source: true
|
|
force_tag: true
|
|
timeout: 60
|
|
state: present
|
|
loop: "{{ images }}"
|