Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • froggit/tools/mygb
1 result
Show changes
Commits on Source (2)
...@@ -31,7 +31,9 @@ Options : ...@@ -31,7 +31,9 @@ Options :
-g path/to/group : export the group and is subgroups and projects -g path/to/group : export the group and is subgroups and projects
-a : export all my group and subgroup -a : export all my group and subgroup
' '
readonly WAITING_TIME=5 # https://docs.gitlab.com/ee/user/group/settings/import_export.html#rate-limits
readonly DELAY_EXPORT=10
readonly DELAY_EXPORT_DL=60
# -- Vars # -- Vars
config_file='.mygb_config' config_file='.mygb_config'
...@@ -124,6 +126,7 @@ _get_project_info() { ...@@ -124,6 +126,7 @@ _get_project_info() {
# ---[ Export Project ]--- # ---[ Export Project ]---
_schedule_project_export() { _schedule_project_export() {
sleep ${DELAY_EXPORT}
_api POST "projects/${project_url_encoded}/export" | jq | grep --silent "202 Accepted" \ _api POST "projects/${project_url_encoded}/export" | jq | grep --silent "202 Accepted" \
|| _fail "Can't schedule export for project [${project}]" || _fail "Can't schedule export for project [${project}]"
} }
...@@ -135,7 +138,7 @@ _project_export_status() { ...@@ -135,7 +138,7 @@ _project_export_status() {
_wait_export_finished() { _wait_export_finished() {
while [[ "$(_project_export_status)" != "finished" ]]; do while [[ "$(_project_export_status)" != "finished" ]]; do
echo "Waiting end of export ..." echo "Waiting end of export ..."
sleep ${WAITING_TIME} sleep ${DELAY_EXPORT_DL}
done done
} }
...@@ -158,6 +161,7 @@ _export_project() { ...@@ -158,6 +161,7 @@ _export_project() {
# ---[ Export Group ]--- # ---[ Export Group ]---
_schedule_group_export() { _schedule_group_export() {
sleep ${DELAY_EXPORT}
_api POST "groups/${group_url_encoded}/export" | jq | grep --silent "202 Accepted" \ _api POST "groups/${group_url_encoded}/export" | jq | grep --silent "202 Accepted" \
|| _fail "Can't schedule export for group [${group}]" || _fail "Can't schedule export for group [${group}]"
} }
...@@ -170,9 +174,9 @@ _group_export_status() { ...@@ -170,9 +174,9 @@ _group_export_status() {
_wait_group_finished() { _wait_group_finished() {
while [[ "$(_group_export_status)" != "finished" ]]; do while [[ "$(_group_export_status)" != "finished" ]]; do
echo "Waiting end of export ..." echo "Waiting end of export ..."
sleep ${WAITING_TIME} sleep ${DELAY_EXPORT_DL}
done done
sleep 60 sleep ${DELAY_EXPORT_DL}
} }
_download_group_export() { _download_group_export() {
......