Created
March 20, 2017 16:17
-
-
Save camlafit/ea54db873d787949b9aa31788a365d07 to your computer and use it in GitHub Desktop.
Import to gitea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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