From f28c7b71d26fbad4ebf1307d64559baf7a63ff86 Mon Sep 17 00:00:00 2001 From: Horvath Gergely Date: Fri, 21 Feb 2020 18:08:24 +0100 Subject: [PATCH] build mxisd for rapsberry pi --- roles/matrix-base/defaults/main.yml | 1 + roles/matrix-base/tasks/setup_matrix_base.yml | 1 + roles/matrix-mxisd/tasks/setup_mxisd.yml | 34 ++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index 84199623a..b7e0681a5 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -29,6 +29,7 @@ matrix_static_files_base_path: "{{ matrix_base_data_path }}/static-files" matrix_docker_src_files_path: "{{ matrix_base_data_path }}/docker-src" matrix_docker_synapse_src_files_path: "{{ matrix_docker_src_files_path }}/synapse" matrix_docker_coturn_src_files_path: "{{ matrix_docker_src_files_path }}/coturn" +matrix_docker_mxisd_src_files_path: "{{ matrix_docker_src_files_path }}/mxisd" matrix_docker_mautrix_facebook_src_files_path: "{{ matrix_docker_src_files_path }}/mautrix-facebook" matrix_homeserver_url: "https://{{ matrix_server_fqn_matrix }}" diff --git a/roles/matrix-base/tasks/setup_matrix_base.yml b/roles/matrix-base/tasks/setup_matrix_base.yml index aa4177eb6..5823e39fa 100644 --- a/roles/matrix-base/tasks/setup_matrix_base.yml +++ b/roles/matrix-base/tasks/setup_matrix_base.yml @@ -25,6 +25,7 @@ - { src: "{{ matrix_docker_src_files_path }}", when: "{{ matrix_raspberry_pi }}" } - { src: "{{ matrix_docker_synapse_src_files_path }}", when: "{{ matrix_raspberry_pi }}" } - { src: "{{ matrix_docker_coturn_src_files_path }}", when: "{{ matrix_coturn_enabled }}"} + - { src: "{{ matrix_docker_mxisd_src_files_path }}", when: "{{ matrix_mxisd_enabled }}"} - { src: "{{ matrix_docker_mautrix_facebook_src_files_path }}", when: "{{ matrix_mautrix_facebook_enabled }}"} # `docker_network` doesn't work as expected when the given network diff --git a/roles/matrix-mxisd/tasks/setup_mxisd.yml b/roles/matrix-mxisd/tasks/setup_mxisd.yml index 2bafa1791..b01327223 100644 --- a/roles/matrix-mxisd/tasks/setup_mxisd.yml +++ b/roles/matrix-mxisd/tasks/setup_mxisd.yml @@ -22,7 +22,39 @@ source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" force_source: "{{ matrix_mxisd_docker_image_force_pull 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_mxisd_docker_image_force_pull }}" - when: matrix_mxisd_enabled|bool + when: matrix_mxisd_enabled|bool and not matrix_raspberry_pi + +- name: Ensure gradel is installed on Raspberry pi for building + apt: + name: + - gradle + state: present + update_cache: yes + when: "matrix_mxisd_enabled|bool and matrix_raspberry_pi" + +- name: Ensure mxisd repository is present on Raspberry pi + git: + repo: https://github.com/kamax-matrix/mxisd.git + dest: "{{ matrix_docker_mxisd_src_files_path }}" + version: "v{{ matrix_mxisd_docker_image.split(':')[1] }}" + force: "yes" + when: "matrix_mxisd_enabled|bool and matrix_raspberry_pi" + +# - name: Ensure mxisd Docker image is build (Raspberry pi) +# docker_image: +# name: "{{ matrix_mxisd_docker_image }}" +# source: build +# build: +# dockerfile: Dockerfile +# path: "{{ matrix_docker_mxisd_src_files_path }}" +# pull: yes +# when: "matrix_mxisd_enabled|bool and matrix_raspberry_pi" + +- name: Ensure mxisd Docker image is build (Raspberry pi) + shell: "./gradlew dockerBuild" + args: + chdir: "{{ matrix_docker_mxisd_src_files_path }}" + when: "matrix_mxisd_enabled|bool and matrix_raspberry_pi" - name: Ensure mxisd config installed copy: