[dd-ctl] Switch to main branch

Evilham 2022-06-03 19:07:53 +02:00
parent b8fad2358e
commit 0a975c79a8
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
4 changed files with 35 additions and 30 deletions

9
.gitmodules vendored
View File

@ -1,8 +1 @@
[submodule "isard-apps"]
path = isard-apps
url = https://gitlab.com/isard/isard-apps
branch = master
[submodule "isard-sso"]
path = isard-sso
url = https://gitlab.com/isard/isard-sso
branch = master

54
dd-ctl
View File

@ -38,7 +38,7 @@ help() {
Stop the project when started: ./dd-ctl down Stop the project when started: ./dd-ctl down
Rescan nextcloud data folders: ./dd-ctl nextcloud-scan Rescan nextcloud data folders: ./dd-ctl nextcloud-scan
Install all prerequisites for installation: ./dd-ctl prerequisites Install all prerequisites for installation: ./dd-ctl prerequisites
Update repository: ./dd-ctl repo-update [branch-name] (defaults to master) Update repository: ./dd-ctl repo-update [branch-name] (defaults to main)
Restart api if changes applied (development): ./dd-ctl restart-api Restart api if changes applied (development): ./dd-ctl restart-api
Update SAML certificates: ./dd-ctl saml Update SAML certificates: ./dd-ctl saml
Set secure passwords in digitaldemocratic.conf: ./dd-ctl securize Set secure passwords in digitaldemocratic.conf: ./dd-ctl securize
@ -73,7 +73,7 @@ if [ "$OPERATION" != "prerequisites" ]; then
fi fi
fi fi
BRANCH="${2:-master}" REPO_BRANCH="${2:-main}"
cp digitaldemocratic.conf .env cp digitaldemocratic.conf .env
@ -117,10 +117,24 @@ prerequisites_pwd(){
} }
update_repo(){ update_repo(){
git fetch && git checkout $BRANCH # Switch to latest version
git fetch && git checkout $REPO_BRANCH
# Needed for dd-apps submodules...
git submodule update --init --recursive git submodule update --init --recursive
cd isard-apps && git fetch && git checkout $BRANCH && git pull && cd .. # Remove old repositories
cd isard-sso && git fetch && git checkout $BRANCH && git pull && cd .. for old_dir in isard-apps isard-sso; do
if [ -d "${old_dir}" ]; then
mkdir -p _old
mv "${old_dir}" "_old/${old_dir}_$(date +'%Y-%m-%d_%H-%M')"
fi
done
# Cleanup
for old_dir in isard-apps isard-sso; do
git submodule deinit "${old_dir}" || true
if [ -d "${old_dir}" ]; then
rmdir "${old_dir}"
fi
done
} }
build_compose(){ build_compose(){
@ -458,43 +472,43 @@ upgrade_plugins_moodle(){
rm auth_saml2.zip rm auth_saml2.zip
if [[ "$MOODLE_PLUGIN_TRESIPUNTSHARE" == *"develop"* ]]; then if [[ "$MOODLE_PLUGIN_TRESIPUNTSHARE" == *"develop"* ]]; then
BRANCH=develop PLUGIN_BRANCH=develop
else else
BRANCH=master PLUGIN_BRANCH=master
fi fi
curl --location $MOODLE_PLUGIN_TRESIPUNTSHARE > tresipuntshare.zip curl --location $MOODLE_PLUGIN_TRESIPUNTSHARE > tresipuntshare.zip
unzip tresipuntshare.zip -d /tmp/moodle/mod/ unzip tresipuntshare.zip -d /tmp/moodle/mod/
mv /tmp/moodle/mod/moodle_mod_tresipuntshare-$BRANCH /tmp/moodle/mod/tresipuntshare mv /tmp/moodle/mod/moodle_mod_tresipuntshare-$PLUGIN_BRANCH /tmp/moodle/mod/tresipuntshare
rm tresipuntshare.zip rm tresipuntshare.zip
if [[ "$MOODLE_PLUGIN_TRESIPUNTVIDEO" == *"develop"* ]]; then if [[ "$MOODLE_PLUGIN_TRESIPUNTVIDEO" == *"develop"* ]]; then
BRANCH=develop PLUGIN_BRANCH=develop
else else
BRANCH=master PLUGIN_BRANCH=master
fi fi
curl --location $MOODLE_PLUGIN_TRESIPUNTVIDEO > tresipuntvideo.zip curl --location $MOODLE_PLUGIN_TRESIPUNTVIDEO > tresipuntvideo.zip
unzip tresipuntvideo.zip -d /tmp/moodle/mod/ unzip tresipuntvideo.zip -d /tmp/moodle/mod/
mv /tmp/moodle/mod/moodle_mod_tresipuntvideo-$BRANCH /tmp/moodle/mod/tresipuntvideo mv /tmp/moodle/mod/moodle_mod_tresipuntvideo-$PLUGIN_BRANCH /tmp/moodle/mod/tresipuntvideo
rm tresipuntvideo.zip rm tresipuntvideo.zip
if [[ "$MOODLE_PLUGIN_TRESIPUNTAUDIO" == *"develop"* ]]; then if [[ "$MOODLE_PLUGIN_TRESIPUNTAUDIO" == *"develop"* ]]; then
BRANCH=develop PLUGIN_BRANCH=develop
else else
BRANCH=master PLUGIN_BRANCH=master
fi fi
curl --location $MOODLE_PLUGIN_TRESIPUNTAUDIO > tresipuntaudio.zip curl --location $MOODLE_PLUGIN_TRESIPUNTAUDIO > tresipuntaudio.zip
unzip tresipuntaudio.zip -d /tmp/moodle/mod/ unzip tresipuntaudio.zip -d /tmp/moodle/mod/
mv /tmp/moodle/mod/moodle_mod_tresipuntaudio-$BRANCH /tmp/moodle/mod/tresipuntaudio mv /tmp/moodle/mod/moodle_mod_tresipuntaudio-$PLUGIN_BRANCH /tmp/moodle/mod/tresipuntaudio
rm tresipuntaudio.zip rm tresipuntaudio.zip
if [[ "$MOODLE_PLUGIN_ASSIGNSUBMISSION" == *"develop"* ]]; then if [[ "$MOODLE_PLUGIN_ASSIGNSUBMISSION" == *"develop"* ]]; then
BRANCH=develop PLUGIN_BRANCH=develop
else else
BRANCH=master PLUGIN_BRANCH=master
fi fi
curl --location $MOODLE_PLUGIN_ASSIGNSUBMISSION > assignsubmission_tipnc.zip curl --location $MOODLE_PLUGIN_ASSIGNSUBMISSION > assignsubmission_tipnc.zip
unzip assignsubmission_tipnc.zip -d /tmp/moodle/mod/assign/submission/ unzip assignsubmission_tipnc.zip -d /tmp/moodle/mod/assign/submission/
mv /tmp/moodle/mod/assign/submission/moodle_assignsubmission_tipnc-$BRANCH /tmp/moodle/mod/assign/submission/tipnc mv /tmp/moodle/mod/assign/submission/moodle_assignsubmission_tipnc-$PLUGIN_BRANCH /tmp/moodle/mod/assign/submission/tipnc
rm assignsubmission_tipnc.zip rm assignsubmission_tipnc.zip
curl --location $MOODLE_PLUGIN_TRESIPUNTMODSPEND > block_tresipuntmodspend.zip curl --location $MOODLE_PLUGIN_TRESIPUNTMODSPEND > block_tresipuntmodspend.zip
@ -502,13 +516,13 @@ upgrade_plugins_moodle(){
rm block_tresipuntmodspend.zip rm block_tresipuntmodspend.zip
if [[ "$MOODLE_THEME_CBE" == *"develop"* ]]; then if [[ "$MOODLE_THEME_CBE" == *"develop"* ]]; then
BRANCH=develop PLUGIN_BRANCH=develop
else else
BRANCH=master PLUGIN_BRANCH=master
fi fi
curl --location $MOODLE_THEME_CBE > tresipunt_theme_cbe.zip curl --location $MOODLE_THEME_CBE > tresipunt_theme_cbe.zip
unzip tresipunt_theme_cbe.zip -d /tmp/moodle/theme/cbe/ unzip tresipunt_theme_cbe.zip -d /tmp/moodle/theme/cbe/
mv /tmp/moodle/theme/cbe/moodle_theme_cbe-$BRANCH/* /tmp/moodle/theme/cbe/ mv /tmp/moodle/theme/cbe/moodle_theme_cbe-$PLUGIN_BRANCH/* /tmp/moodle/theme/cbe/
rm tresipunt_theme_cbe.zip rm tresipunt_theme_cbe.zip
#mkdir -p /tmp/moodle/local/tresipuntimportgc #mkdir -p /tmp/moodle/local/tresipuntimportgc

@ -1 +0,0 @@
Subproject commit c0f7ee13b2c0daae32a4e05eb8411192038df0c0

@ -1 +0,0 @@
Subproject commit 3391e00cc32b03e6d12268f53c0bec2f4e2c74f5