Skip to content

Instantly share code, notes, and snippets.

@camlafit
Created March 20, 2017 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camlafit/ea54db873d787949b9aa31788a365d07 to your computer and use it in GitHub Desktop.
Save camlafit/ea54db873d787949b9aa31788a365d07 to your computer and use it in GitHub Desktop.
Import to gitea
REPOS_SOURCE=$(find /var/opt/gitea/gitosis/*/{_plugins_,_outils_} -maxdepth 2 -iname *.git)
PROJECT_UID=1
PROJECT_ORG=name_1
for repo_source in $REPOS_SOURCE; do
echo $repo_source
repo_name=$(basename $repo_source .git)
repo_target=$PROJECT_REPO/$PROJECT_ORGA/$repo_name.git
## IMPORT in gitea
curl -H "Authorization: token $TOKEN" \
--data "clone_addr=$repo_source&uid=$PROJECT_UID&repo_name=$repo_name" \
http://$IP:$PORT/api/v1/repos/migrate
if [ ! -d "$repo_target" ]; then
echo "Pas de projet cible"
exit 1;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment