Skip to content
Snippets Groups Projects
Commit 1f706dfb authored by vahid zolfaghari's avatar vahid zolfaghari Committed by Ugo Albanese
Browse files

Merged in NRRPLT-8314-move-backup-process (pull request #82)

[NRRPLT-8306] Refactor backup routine. Call it before build.

Approved-by: Ugo Albanese
parent 77bbd47b
No related branches found
No related tags found
No related merge requests found
......@@ -310,6 +310,10 @@ function process_models {
echo
echo "Copying the models from Models to nrpStorage/TEMPLATE_MODELS"
./copy-to-storage.sh || { echo ERROR; exit 1; }
}
function backup_storage() {
# Get the NRP version using the git tag of one of main repositories (in this case CLE)
pushd "$HBP"/CLE >/dev/null || { echo ERROR; exit 1; }
nrp_version=$(git describe --abbrev=0 --tags)
......@@ -325,16 +329,15 @@ function process_models {
then
echo "Already backed up. continue.. "
else
zip_name="NRP_STORAGE_$(date +%d.%m.%y-%H:%I).bak.zip"
zip -r ../"$zip_name" ./* 1> /dev/null || { echo ERROR; exit 1; }
echo "$zip_name" "created successfully"
my_date=$(date +%d.%m.%y-%H:%I)
back_name=NRP_STORAGE_"$my_date".bak.zip
zip -r ../back_name ./* 1> /dev/null 2>&1
echo "$back_name was created in $(dirname $STORAGE_PATH)"
fi
popd >/dev/null || { echo ERROR; exit 1; }
fi
fi
./copy-to-storage.sh || { echo ERROR; exit 1; }
}
}
function nrp_build {
build_all=$1
......@@ -344,6 +347,9 @@ function nrp_build {
echo =========================
echo Building
echo =========================
backup_storage
if [ "$build_all" = "all" ]; then
build_gazebo_dependencies
build_gazebo
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment