-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b357439
commit c67f6ff
Showing
5 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
if [ "$#" -ne 1 ] ; then | ||
echo "Script to compress the release" | ||
echo "Usage: prepare_release.sh <version>" | ||
echo "Usage example: ./prepare_release_for_github.sh 14.09.30" | ||
exit 0 | ||
fi | ||
|
||
version=$1 | ||
app=odissea | ||
filename=$app"_v"$version | ||
|
||
cd /tmp | ||
git clone https://github.com/projectestac/$app.git | ||
cd $app | ||
git submodule update --recursive --init | ||
|
||
find . -name '\.git*' -exec rm -rf {} \; | ||
|
||
echo "Creating file $filename.tar.gz" | ||
tar cfzp ../$filename.tar.gz * | ||
|
||
echo "Creating file $filename.zip" | ||
zip -r -q ../$filename.zip . | ||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
source "update_functions.sh" | ||
|
||
get_action $1 | ||
|
||
echo 'Pull inicial' | ||
git_pull master | ||
|
||
pull_submodules | ||
|
||
echo "Garbage collecting..." | ||
git gc | ||
|
||
echo "That's all folks!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Call example: ./update_app_from_parent.sh | ||
|
||
version=20.11.03 | ||
|
||
pushd /tmp | ||
|
||
git clone https://github.com/projectestac/agora_moodle2.git | ||
git clone https://github.com/projectestac/odissea.git | ||
|
||
pushd agora_moodle2 | ||
git submodule update --init --recursive | ||
find . -name '\.git*' -exec rm -rf {} \; 2>/dev/null | ||
popd | ||
|
||
data=`date +"%Y%m%d"` | ||
|
||
pushd odissea | ||
git checkout -b UPSTREAM origin/UPSTREAM | ||
rm -rf html/ | ||
mv ../agora_moodle2 html | ||
git add -A | ||
git commit -m 'Updated from agora_moodle2 repository ('$data')' | ||
git push origin UPSTREAM | ||
popd | ||
|
||
popd | ||
|
||
printf "\nRemaining work: rebase master using UPSTREAM. Conflicts may arise.\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/bin/bash | ||
|
||
function gitcheckout { | ||
dir=$1 | ||
branch=$2 | ||
remote=$3 | ||
|
||
if [ ! "$(ls -A $dir)" ]; then | ||
# Empty directory | ||
update_exec "git submodule sync --recursive" | ||
update_exec "git submodule update --init --recursive" | ||
|
||
if [ ! "$(ls -A $dir)" ]; then | ||
echo 'ERROR: el directori $dir no existeix o és buit' | ||
exit -1 | ||
fi | ||
fi | ||
|
||
echo "Entrant $dir BRANCH $branch REPO $remote ..." | ||
pushd $dir > /dev/null | ||
if [ ! -z "$remote" ]; then | ||
update_exec "git remote set-url origin $remote" | ||
update_exec "git fetch" | ||
fi | ||
|
||
update_exec "git checkout $branch" | ||
|
||
git_pull $branch | ||
|
||
popd > /dev/null | ||
echo 'OK' | ||
} | ||
|
||
function git_pull { | ||
branch=$1 | ||
if [[ $action == 'stash' ]] | ||
then | ||
update_exec "git stash" | ||
fi | ||
|
||
if [[ $action == 'reset' ]] | ||
then | ||
update_exec "git reset --hard origin/$branch" | ||
fi | ||
|
||
update_exec "git pull" | ||
|
||
if [[ $action == 'stash' ]] | ||
then | ||
if [[ -n $(git stash list) ]]; then | ||
echo ' >>>> Aplicat Stash' | ||
update_exec "git stash pop" | ||
fi | ||
fi | ||
|
||
if [[ $action == 'gc' ]] | ||
then | ||
update_exec "git gc" | ||
fi | ||
} | ||
|
||
function update_exec { | ||
if ! $1 > /dev/null | ||
then | ||
echo >&2 "ERROR: on $1" | ||
|
||
exit 0 | ||
fi | ||
} | ||
|
||
function get_action { | ||
tempaction=$1 | ||
|
||
if [[ $tempaction == 'reset' ]] | ||
then | ||
echo 'Demanat RESET' | ||
action=$tempaction | ||
elif [[ $tempaction == 'stash' ]] | ||
then | ||
echo 'Demanat STASH' | ||
action=$tempaction | ||
elif [[ $tempaction == 'gc' ]] | ||
then | ||
echo 'Demanat GC' | ||
action=$tempaction | ||
else | ||
action="" | ||
fi | ||
} | ||
|
||
function pull_submodules { | ||
if [[ $action != 'reset' ]] | ||
then | ||
echo 'Inicialitzant submòduls...' | ||
update_exec "git submodule update --recursive --init" | ||
|
||
echo 'Sincronitzant submòduls...' | ||
update_exec "git submodule sync" | ||
fi | ||
|
||
./update_submodules.sh | ||
} | ||
|
||
function end_exec { | ||
echo "Garbage collecting..." | ||
git gc | ||
|
||
echo "That's all folks!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
source "update_functions.sh" | ||
|
||
gitcheckout "html/admin/tool/odisseagtafsync" "master" "[email protected]:projectestac/moodle-admin_odisseagtafsync.git" | ||
gitcheckout "html/blocks/configurable_reports" "MOODLE_36_STABLE" "https://github.com/jleyva/moodle-block_configurablereports.git" | ||
gitcheckout "html/auth/saml2" "master" "https://github.com/projectestac/moodle-auth_saml2.git" |