Showing posts with label nodejs. Show all posts
Showing posts with label nodejs. Show all posts

Friday, April 25, 2014

Continuous Integration and Deployment using Bamboo and AWS Elastic Beanstalk

Walk-through of setting up Bamboo as CI and CD  

Bamboo is a popular Atlassion product . Lets go setup bamboo and discuss what steps did I do.
  • Install Bamboo on an EC2 instance
    • Configure to run on Port 80 instead on its default.
    • Make sure system has enough memory, I am using a m1.small instance. 
    • Bamboo has a startup script, use that , and make sure the permission thing.:P
  • For CI - 
    • Checkout the code
      • Used post push hook to automate the build plan on bamboo
    • Install dependencies
      • Remember to clean cache and remove the node_modules before installing
    • Run tests
      • Used Bamboo-mocha plugin for that. Ample doc is provided for that
    • Thats it !!
  • For CD -
    • Setup the deployment Server -
      • We are using Amazon Beanstalk,, our app being a Node.JS one.
    • The deployment process is tricky. Manually we have to initialize the repo and feed in a lot of details. But to do it automatically 
      • Initialize the repository with the AWSDevTools-RepositorySetup.sh script. It will add git aliases . We will now have git aws.push command
      • The deploy script searches for a file named aws_credentials_file, in the Home folder of the user in .elasticbeanstalk dir. So one task is to copy a file in home folder during each deployment.
    • Rest is simple.

This blog also has a lot of important details that helped me - http://blog.pedago.com/2014/02/18/build-and-deploy-with-grunt-bamboo-and-elastic-beanstalk/

Next step to include Code Coverage .. Will mention it in next blog post.