From 28957f185483ce54cd8a2628091a83577e102f49 Mon Sep 17 00:00:00 2001 From: darta Date: Thu, 20 Jan 2022 13:53:03 +0100 Subject: [PATCH] fix(moodle): upgrade plugins with develop branch --- dd-ctl | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/dd-ctl b/dd-ctl index 794082b..be128e4 100755 --- a/dd-ctl +++ b/dd-ctl @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ ! -d "custom" ]; then echo "You need to copy custom.sample to custom folder and adapt it to your needs." && exit 1; fi if [ ! -f "digitaldemocratic.conf" ]; then echo "You need to copy digitaldemocratic.conf.sample to digitaldemocratic.conf and adapt" && exit 1; fi @@ -322,34 +322,58 @@ upgrade_plugins_moodle(){ rm -rf /tmp/moodle/auth/moodle-auth_saml2-role_map rm auth_saml2.zip + if [[ "$MOODLE_PLUGIN_TRESIPUNTSHARE" == *"develop"* ]]; then + BRANCH=develop + else + BRANCH=master + fi curl --location $MOODLE_PLUGIN_TRESIPUNTSHARE > tresipuntshare.zip unzip tresipuntshare.zip -d /tmp/moodle/mod/ - mv /tmp/moodle/mod/moodle_mod_tresipuntshare-master /tmp/moodle/mod/tresipuntshare + mv /tmp/moodle/mod/moodle_mod_tresipuntshare-$BRANCH /tmp/moodle/mod/tresipuntshare rm tresipuntshare.zip + if [[ "$MOODLE_PLUGIN_TRESIPUNTVIDEO" == *"develop"* ]]; then + BRANCH=develop + else + BRANCH=master + fi curl --location $MOODLE_PLUGIN_TRESIPUNTVIDEO > tresipuntvideo.zip unzip tresipuntvideo.zip -d /tmp/moodle/mod/ - mv /tmp/moodle/mod/moodle_mod_tresipuntvideo-master /tmp/moodle/mod/tresipuntvideo + mv /tmp/moodle/mod/moodle_mod_tresipuntvideo-$BRANCH /tmp/moodle/mod/tresipuntvideo rm tresipuntvideo.zip + if [[ "$MOODLE_PLUGIN_TRESIPUNTAUDIO" == *"develop"* ]]; then + BRANCH=develop + else + BRANCH=master + fi curl --location $MOODLE_PLUGIN_TRESIPUNTAUDIO > tresipuntaudio.zip unzip tresipuntaudio.zip -d /tmp/moodle/mod/ - mv /tmp/moodle/mod/moodle_mod_tresipuntaudio-master /tmp/moodle/mod/tresipuntaudio + mv /tmp/moodle/mod/moodle_mod_tresipuntaudio-$BRANCH /tmp/moodle/mod/tresipuntaudio rm tresipuntaudio.zip + if [[ "$MOODLE_PLUGIN_ASSIGNSUBMISSION" == *"develop"* ]]; then + BRANCH=develop + else + BRANCH=master + fi curl --location $MOODLE_PLUGIN_ASSIGNSUBMISSION > assignsubmission_tipnc.zip unzip assignsubmission_tipnc.zip -d /tmp/moodle/mod/assign/submission/ - mv /tmp/moodle/mod/assign/submission/moodle_assignsubmission_tipnc-master /tmp/moodle/mod/assign/submission/tipnc + mv /tmp/moodle/mod/assign/submission/moodle_assignsubmission_tipnc-$BRANCH /tmp/moodle/mod/assign/submission/tipnc rm assignsubmission_tipnc.zip curl --location $MOODLE_PLUGIN_TRESIPUNTMODSPEND > block_tresipuntmodspend.zip unzip block_tresipuntmodspend.zip -d /tmp/moodle/blocks/ rm block_tresipuntmodspend.zip + if [[ "$MOODLE_THEME_CBE" == *"develop"* ]]; then + BRANCH=develop + else + BRANCH=master + fi curl --location $MOODLE_THEME_CBE > tresipunt_theme_cbe.zip unzip tresipunt_theme_cbe.zip -d /tmp/moodle/theme/cbe/ - mv /tmp/moodle/theme/cbe/moodle_theme_cbe-master/* /tmp/moodle/theme/cbe/ - mv /tmp/moodle/theme/cbe/moodle_theme_cbe-develop/* /tmp/moodle/theme/cbe/ + mv /tmp/moodle/theme/cbe/moodle_theme_cbe-$BRANCH/* /tmp/moodle/theme/cbe/ rm tresipunt_theme_cbe.zip mkdir -p /tmp/moodle/local/tresipuntimportgc