diff options
author | Yaco <franco@reevo.org> | 2023-04-26 15:38:12 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2023-04-26 15:38:12 -0300 |
commit | 4a272f1f23f08c91beb126a86d1c80cf59ddfc37 (patch) | |
tree | 0cceca007963f0aa8c00419fe1ec78507f428073 /bin/reevotech | |
parent | 41a0cd881fabc071458a49b2c86f370aad5ca5a1 (diff) |
updates scripts
Diffstat (limited to 'bin/reevotech')
-rw-r--r-- | bin/reevotech/CreateSemanticObject.sh | 4 | ||||
-rwxr-xr-x | bin/reevotech/PullPages.sh | 43 | ||||
-rwxr-xr-x | bin/reevotech/PutPages.sh | 31 |
3 files changed, 58 insertions, 20 deletions
diff --git a/bin/reevotech/CreateSemanticObject.sh b/bin/reevotech/CreateSemanticObject.sh deleted file mode 100644 index 87dc64a9..00000000 --- a/bin/reevotech/CreateSemanticObject.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "This script is used to create a Semantic Object defined in a specific Deployment" -echo "" diff --git a/bin/reevotech/PullPages.sh b/bin/reevotech/PullPages.sh index 475b5485..29071c24 100755 --- a/bin/reevotech/PullPages.sh +++ b/bin/reevotech/PullPages.sh @@ -11,26 +11,47 @@ cd /srv/reevotech DEPLOY=$1 DEPLOYFILE=`ls ./etc | grep $DEPLOY | grep -v '.test' | grep -v '.old'` -echo $DEPLOYFILE -read -NS=$2 DOMAIN=`cat ./etc/$DEPLOYFILE | grep 'REEVO_URL =' | cut -d'"' -f 2` + # echo $DEPLOY # echo $DEPLOYFILE # echo $DOMAIN cd ./www/wiki/deployments/$DEPLOY -if [[ -d pages_tmp/$NS ]] +update_ns () { + if [[ -d pages_tmp/$1 ]] + then + echo "" + cd pages_tmp/$1 + git pull + cd ../../ + else + git clone -c remote.origin.namespaces="$1" mediawiki::http://$DOMAIN pages_tmp/$1 + fi + + cp -rf pages_tmp/$1 pages + rm -rf pages/$1/.git +} + +NS=$2 + +if [ -z "$2" ] then + echo "This script download the wikipages in the DB to text files..." + echo "I am going to process all the active NameSpaces for the specified deployment:" + ls pages echo "" - cd pages_tmp/$NS - git pull - cd ../../ + echo "Enter to continue..." + read + for i in `ls pages` + do + update_ns $i + done + else - git clone -c remote.origin.namespaces="$NS" mediawiki::http://$DOMAIN pages_tmp/$NS + echo "This script download the wikipages in the DB to text files..." + echo "I am going to process only the specificed NameSpace: $NS" + update_ns $NS fi - -cp -rf pages_tmp/$NS pages -rm -rf pages/$NS/.git diff --git a/bin/reevotech/PutPages.sh b/bin/reevotech/PutPages.sh index 831a8616..abf6065e 100755 --- a/bin/reevotech/PutPages.sh +++ b/bin/reevotech/PutPages.sh @@ -7,13 +7,34 @@ if [ $# -eq 0 ] exit fi +DEPLOY=$1 +cd /srv/reevotech/www/wiki/maintenance/ -cd /srv/reevotech +update_ns () { + echo "" + echo "########### Updating pages in $1" + php importTextFiles.php --conf ../LocalSettings-$DEPLOY.php -s "Updated using PutPages.sh" --overwrite "../deployments/$DEPLOY/pages/$1/*" + echo "" +} -DEPLOY=$1 NS=$2 +if [ -z "$2" ] +then + echo "This script replaces the wikipages from the text files to the DB..." + echo "I am going to update pages in all the active NameSpaces for the specified deployment:" + ls ../deployments/$DEPLOY/pages/ + echo "" + # echo "Enter to continue..." + read + for i in `ls ../deployments/$DEPLOY/pages/` + do + update_ns $i + done -cd /srv/reevotech/www/wiki/maintenance/ - +else + echo "This script replaces the wikipages from the text files to the DB..." + echo "I am going to process only the specificed NameSpace: $NS" + update_ns $NS +fi -php importTextFiles.php --conf ../LocalSettings-$DEPLOY.php -s "Updated using PutPages.sh" --overwrite "../deployments/$DEPLOY/pages/$NS/*" +/usr/bin/php runJobs.php --conf /srv/reevotech/www/wiki/LocalSettings-$DEPLOY.php |