Created
September 25, 2015 18:20
-
-
Save paulkearney/6042561c56654a15af3c to your computer and use it in GitHub Desktop.
Migrating from GitHub to AWS CodeCommit
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
while read r; do | |
echo $r | |
aws codecommit delete-repository --repository-name $r --region us-east-1 | |
done < ~/dev/utility-scripts/aws/codecommit/repos.txt |
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
while read r; do | |
echo $r | |
curl -X DELETE -u $GITHUB_USER:$GITHUB_PASSWD https://api.github.com/repos/$GITHUB_ORG/$r | |
done < ~/dev/utility-scripts/aws/codecommit/repos.txt |
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
curl --silent -u $GITHUB_USER:$GITHUB_PASSWD https://api.github.com/orgs/$GITHUB_ORG/repos?per_page=100 -q | grep "\"name\"" | awk -F': "' '{print $2}' | sed -e 's/",//g' >> ~/dev/utility-scripts/aws/codecommit/repos.txt |
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
cd ~/_trash | |
while read r; do | |
echo $r | |
aws codecommit create-repository --repository-name $r --region us-east-1 | |
git clone --mirror [email protected]:$GITHUB_ORG/$r.git | |
cd $r.git | |
git push ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/$r --all | |
git push ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/$r --tags | |
sleep 10 | |
aws codecommit update-default-branch --repository-name $r --default-branch-name master --region us-east-1 | |
cd .. | |
done < ~/dev/utility-scripts/aws/codecommit/repos.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works smoothless, thanks!