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

Resolve "export one group, all sub groups and level 1 project"

1 file
+ 11
5
Compare changes
  • Side-by-side
  • Inline
+ 11
5
@@ -117,8 +117,8 @@ _api() {
"${gitlab_url}api/v4/${path}"
}
_get_projects() {
_api GET "projects?simple=true&owned=true" | jq '.[].path_with_namespace'
_get_projects_from_group() {
_api GET "groups/${group_url_encoded}/projects" | jq -r '.[].path_with_namespace'
}
_get_project_info() {
@@ -152,6 +152,8 @@ _download_project_export() {
}
_export_project() {
set -x
project_url_encoded="${project/\//%2F}"
if [[ -n ${project} ]]; then
echo -e "\nExporting project : [${project}] in ${mygb_tmp_dir} ..."
_schedule_project_export
@@ -189,11 +191,18 @@ _download_group_export() {
}
_export_group() {
group_url_encoded="${group/\//%2F}"
if [[ -n ${group} ]]; then
echo -e "\nExporting group : [${group}] in ${mygb_tmp_dir} ..."
_schedule_group_export
_wait_group_finished
_download_group_export
_get_projects_from_group
projects=$(_get_projects_from_group)
for project in ${projects}; do
_export_project
done
fi
}
@@ -229,9 +238,6 @@ main() {
esac
done
project_url_encoded="${project/\//%2F}"
group_url_encoded="${group/\//%2F}"
case "${action}" in
init) _create_config ;;
export) _export ;;
Loading