Closed reidca closed 3 months ago
I think I discovered why this happened - it seems I had the environment variable AWS_DEFAULT_PROFILE set pointing to a totally different profile. This caused issues elsewhere so it may have also caused this. Although I have read that AWS_PROFILE should take precedence over AWS_DEFAULT_PROFILE so I am not 100% certain. Either way, it might be useful for the documentation to mention that the user should check this prior to running the deploy.sh script.
Describe the bug When running the deploy.sh script provided the code commit command "git push origin main" errors.
To Reproduce Steps to reproduce the behavior:
Expected behavior The script should push the content into the Code Commit repo successfully
Desktop (please complete the following information):
Additional context After reading the AWS documentation, I discovered this page: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-git-remote-codecommit.html#:~:text=To%20clone%20the%20same%20repository%20using%20a%20profile%20named%20CodeCommitProfile%3A
In this page it mentions how to use a named profile for the git command:
git clone codecommit://CodeCommitProfile@MyDemoRepo my-demo-repo
To fix this, I updated the command in the deploy.sh
FROM:
git remote add origin codecommit::$REGION://team-idc-app
TO:git remote add origin codecommit::$REGION://$TEAM_ACCOUNT_PROFILE@team-idc-app
This has resolved the problem.