Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit e703bc1b authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Git clone ou git pull

Dump des projets git plus malin
parent f46c875c
......@@ -278,6 +278,10 @@ iput -f $LOCAL_REPORT $IRODS_REPORT
if [ -z ${GITLAB_TOKEN+x} ]; then
echo "GITLAB_TOKEN is not set. We will NOT dump gitlab projects"
else
KEY=git_projects
if [[ -r $RECOVERY_FILE ]] && egrep -q -e ".*($KEY ).*( OK | Skipped ).*" $RECOVERY_FILE ; then
format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S) "-" "-" "Skipped" >> $LOCAL_REPORT
else
username="ccdump"
# number of results per pages (max = 100)
per_page=50
......@@ -298,19 +302,25 @@ else
if [[ "$url" =~ $pattern ]]; then
destdir=$RESIFDD_WORKDIR/projects/${BASH_REMATCH[1]}
project=${BASH_REMATCH[2]}
echo "Cloning $url in $destdir/$project"
mkdir -p $destdir
if [[ -d $destdir/$project ]]; then
echo "Pulling $url in $destdir/$project"
git -C $destdir/$project pull
else
echo "Cloning $url in $destdir/$project"
git clone -q --bare https://$username:$GITLAB_TOKEN@$url $destdir/$project
fi
fi
done
done
# Now compress all the project and send to irods
KEY=git_projects
tar cJf $RESIFDD_WORKDIR/${KEY}.tar.xz $RESIFDD_WORKDIR/projects
tar cJf $RESIFDD_WORKDIR/${KEY}.tar.xz -C $RESIFDD_WORKDIR $RESIFDD_WORKDIR/projects
iput --retries 5 -T -f -X $RESIFDD_WORKDIR/${KEY}.restart $RESIFDD_WORKDIR/${KEY}.tar.xz .
rm -rf $RESIFDD_WORKDIR/projects $RESIFDD_WORKDIR/${KEY}.tar.xz
else
echo "ERROR: gitlab projects could not be dumped, maybe token or gitlab url is wrong ?"
fi
fi
fi
......
Markdown is supported
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