- name: Build containers images hosts: localhost gather_facts: false vars: force_rm: false cache: false repository: code.philo.ydns.eu organisation: philorg tasks: #- name: Read conf # ansible.builtin.include_vars: # file: prod.yaml # name: conf - name: Build the database image tags: db containers.podman.podman_image: name: treetrail-database state: build path: "{{ playbook_dir }}" build: format: oci force_rm: "{{ force_rm }}" cache: "{{ cache }}" file: Containerfile.database push: true push_args: dest: "{{ repository }}/{{ organisation }}" - name: Using the variables ansible.builtin.debug: var: force_rm - name: Get the version from git tags: - ci - deps - backend command: git describe --dirty --tags register: version args: chdir: "{{ playbook_dir }}" - name: Build the base CI image tags: ci containers.podman.podman_image: name: treetrail-backend-ci tag: "{{ version.stdout }}" state: build path: "{{ playbook_dir }}" build: format: oci force_rm: "{{ force_rm }}" cache: "{{ cache }}" file: Containerfile.ci push: true push_args: dest: "{{ repository }}/{{ organisation }}" - name: Build the base image, only with python dependencies tags: deps containers.podman.podman_image: name: treetrail-backend-deps tag: "{{ version.stdout }}" state: build path: "{{ playbook_dir }}" build: format: oci force_rm: "{{ force_rm }}" cache: "{{ cache }}" file: Containerfile.deps push: true push_args: dest: "{{ repository }}/{{ organisation }}" - name: Build the backend container image tags: backend containers.podman.podman_image: name: treetrail-backend tag: "{{ version.stdout }}" state: build force: true path: "{{ playbook_dir }}" build: format: oci force_rm: "{{ force_rm }}" cache: "{{ cache }}" file: Containerfile extra_args: "--build-arg APP_VERSION={{ version.stdout }}" push: true push_args: dest: "{{ repository }}/{{ organisation }}"