Instantly share code, notes, and snippets.

Embed
What would you like to do?
Migrating from GitHub to AWS CodeCommit
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
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
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
cd ~/_trash
while read r; do
echo $r
aws codecommit create-repository --repository-name $r --region us-east-1
git clone --mirror git@github.com:$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
@paulkearney

This comment has been minimized.

@hmngwy

This comment has been minimized.

hmngwy commented Oct 21, 2015

sir, you are a godsend

@NomikOS

This comment has been minimized.

NomikOS commented Jul 20, 2017

It works smoothless, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment