Wednesday, March 9, 2016

CodeCommit

1) Create a userid and grant codecommitfullaccess policy for the poc purpose
2) Create a repository named jrepo in AWS CodeCommit
3) Copy the https url (example: https://git-codecommit.us-east-1.amazonaws.com/v1/repos/jrepo)
4) Setup AWS CLI
5) Install AWS Tools from https://aws.amazon.com/powershell/


6) Run windows command utility as administrator
7) cd %PROGRAMFILES(X86)%\AWS Tools\CodeCommit
8) git-credential-AWSS4.exe -p jcodecommit
    Note: jcodecommit is profile name stored in AWS config or credentials file  (under users home .aws dir)
    Choose Yes to generate sig
9) Run git config --global --edit and you should see a similar block
[credential]
helper = !'C:\\Users\\j\\AppData\\Roaming\\GitCredStore\\git-credential-AWSSV4.exe' --profile=jcodecommit
UseHttpPath = true

10) Create a local directory named codecommitrepos
11) cd c:\codecommitrepos
12) git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/jrepo local-jrepo
13) git config --local user.name "developer1"
14) git config --local user.email developer1@email.com

15) cd c:\codecommitrepos\local-jrepo
15)  Create files index.html and index2.html
16) git add index.html
17) git commit -m "Added index.html'
16) git add index2.html
17) git commit -m "Added index2.html'

18) git push -u origin master

Voila! The files are now pushed to AWS CodeCommit.


1 comment: