September 27, 2018

LAB 10: Setup Repository in AWS CodeCommit for Lambda

This Lab has the step by step instructions to setup a Repository in AWS CodeCommit, add the pre-developed Lambda Application Code and commit the Changeset
Ensure that you have already went through the AWS CI CD using AWS Developer Tools & create IAM User, Group and S3 bucket before we move forward.
  1. Login to AWS Console as `codedeploy_user` & go to AWS CodeCommit dashboard
  2. Create an empty repository ascodecommit_lambda and you may Skip SNS Topic as of now and view the Connect to your repository screen

  1. 3. Get the clone URL (say git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/codecommit_lambda), paste run it on your terminal. It will ask for username and password, enter the Git Credentials you have generated in Lab-9You will get a warning that you appear to have cloned an empty repository and you are good to proceed.

  2. Download the Serverless Application source code from here and commit to your Git Repo using the commands as in below command line reference
  3. $ git clone <git URL>

                $ git init
     
                $ git status
  4. $ git add .
  5.                   $ git commit -m "Adding Serverless Application to CodeCommit Repo"
                      $ git push
                      $ git status

Now your source code is in git and may use the below command to commit the changes, if any, to the source code
  • git status - To view the changes 
  • git add . - to add all changes to the local repo and use git add <folder[/file]> to add selected folder or file to the local repo
  • git rm . - to add all changes to the local repo and use git rm <folder[/file]> to add selected folder or file to the local repo
  • git commit -m “what changes are getting in”
  • git commit --amend - will open the editor for you to modify the commit. Commit can be modified from command line as well using git commit --amend -m “New Commit”
  • git push - push the changes to the remote
  • git log -2 - gives the last two commit
  • git  branch -lvv - gives the local branches with remote mapping
  • git checkout <branchname> - to checkout from a remote branch
  • git branch -D <branchname> - to delete a local branch
  • git reset --hard <branchname> - to do a hard reset to the head of the revision from the remote - This is helpful if your local branch is messed-up and you want to overwrite everything from remote.

No comments:

Post a Comment