CloudInDetail
Published in

CloudInDetail

How to Automate AWS Serverless — Code Commit

Here we will see how can we automate our Serverless projects in detail view. I am using AWS code commit, Code Build, Code Deploy for this CI/CD. Also used Serverless framework to create the project.

In this article we will learn how to use Code Commit in AWS.

Initial step you need a new Serverless project and follow the below steps.

  1. You need to add a git repository to your project by adding >git init to your project
  2. Add a dev branch and a master branch to your project > git checkout -b dev, > it checkout -b master
  3. Add your changes with command > git add .
  4. commit your changes to local dev branch using > git commit — am “first commit”

Now We use AWS console and use AWS Code Commit to add the git repository we created in above steps.

Figure 1

Click on Create Repository in Code commit console and create repository. once the repository is created you get a git clone link in connection steps page.

Remember to generate git credentials if you have not done before to push the code to this repository you created.

Now back to your code and use below command to link your code to the code commit git repo.

> git remote add origin {{repo name highlighted}}

To verify the above git is properly connected use command > git remote -v

to push your changes use command > git push — set-upstream origin dev

switch to master branch, by >git checkout master

similarly do it for master using command >git push — set-upstream origin dev

Now if you goto code commit we can see our branches created

continue this article here https://medium.com/cloudindetail/aws-code-pipe-line-c13a313e81fc

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Praveen Sambu

Praveen Sambu

Software Engineer |AWS Community Builder |Technical Blogger | Trainer . Founder of Cloud In Detail (https://cloudindetail.com/) still working on building blog…