@ -56,6 +56,26 @@
force : "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_telegram_docker_image_force_pull }}"
force : "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_telegram_docker_image_force_pull }}"
when : "not matrix_mautrix_telegram_container_self_build|bool"
when : "not matrix_mautrix_telegram_container_self_build|bool"
- name : Ensure lottieconverter is present when self-building
git:
repo : "{{ matrix_lottieconverter_docker_repo }}"
dest : "{{ matrix_lottieconverter_docker_src_files_path }}"
force : "yes"
register : matrix_lottieconverter_git_pull_results
when : "matrix_lottieconverter_container_self_build|bool and matrix_mautrix_telegram_container_self_build|bool"
- name : Ensure lottieconverter Docker image is built
docker_image:
name : "{{ matrix_lottieconverter_docker_image }}"
source : build
force_source : "{{ matrix_lottieconverter_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force : "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_lottieconverter_git_pull_results.changed }}"
build:
dockerfile : Dockerfile
path : "{{ matrix_lottieconverter_docker_src_files_path }}"
pull : yes
when : "matrix_lottieconverter_container_self_build|bool and matrix_lottieconverter_git_pull_results.changed and matrix_mautrix_telegram_container_self_build|bool"
- name : Ensure matrix-mautrix-telegram repository is present when self-building
- name : Ensure matrix-mautrix-telegram repository is present when self-building
git:
git:
repo : "{{ matrix_mautrix_telegram_docker_repo }}"
repo : "{{ matrix_mautrix_telegram_docker_repo }}"
@ -63,7 +83,12 @@
force : "yes"
force : "yes"
register : matrix_mautrix_telegram_git_pull_results
register : matrix_mautrix_telegram_git_pull_results
when : "matrix_mautrix_telegram_container_self_build|bool"
when : "matrix_mautrix_telegram_container_self_build|bool"
ignore_errors : yes
- name : Ensure TARGETARCH is beeing masked
command : sed -i "3s/ARG/#ARG/" "{{ matrix_mautrix_telegram_docker_src_files_path }}/Dockerfile"
when : "matrix_lottieconverter_container_self_build_mask_arch|bool"
- name : Ensure matrix-mautrix-telegram Docker image is built
- name : Ensure matrix-mautrix-telegram Docker image is built
docker_image:
docker_image:
name : "{{ matrix_mautrix_telegram_docker_image }}"
name : "{{ matrix_mautrix_telegram_docker_image }}"
@ -73,9 +98,14 @@
build:
build:
dockerfile : Dockerfile
dockerfile : Dockerfile
path : "{{ matrix_mautrix_telegram_docker_src_files_path }}"
path : "{{ matrix_mautrix_telegram_docker_src_files_path }}"
pull : yes
pull : "{{ not matrix_lottieconverter_container_self_build_mask_arch|bool }}"
when : "matrix_mautrix_telegram_container_self_build|bool and matrix_mautrix_telegram_git_pull_results.changed"
when : "matrix_mautrix_telegram_container_self_build|bool and matrix_mautrix_telegram_git_pull_results.changed"
# Unmask so no git changes are beeing detected
- name : Ensure TARGETARCH is beeing unmasked
command : sed -i "3s/#ARG/ARG/" "{{ matrix_mautrix_telegram_docker_src_files_path }}/Dockerfile"
when : "matrix_lottieconverter_container_self_build_mask_arch|bool"
- name : Check if an old database file already exists
- name : Check if an old database file already exists
stat:
stat:
path : "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"
path : "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"