0

Recently I have been involved in a project where I have set up a LAMP stack in AWS and also helping out the team for building other infrastructure. As per company policy, we need to create a new instance in every 60 days taking the latest ami and kill the previous one. For this reason, I requested the development team to move the php code to git repo. This would help me automate the build so that I can directly pull the code from git. But, they are saying they don't want to move the code in git for some licensing reason as the code they are using have been purchased from phpgrid (vendor). This is little strange to me...anyways, if the code is NOT in git, how can we automate the code deployment in webserver? Any thoughts on the best practices? Don't want to ftp the code from someone's machine :(

4
  • 2
    I suspect they dont want the code to end-up on a public git platform. But, git is not github (or any other public 'git-ish' service. You can build your own git server somewhere safe in your entreprise architecture, and use that as the repo (i.e. meet all the so-called requirements for protecting intellectual property). Commented Apr 20, 2016 at 16:07
  • Their OWN code should go in Git. Any external dependencies should be resolved by them automagically in their references. You can still put external code in there too, though. There's no issue with that. If you're using third party code, then you should be appropriately licensed to use it anyway, so it won't matter if you copy that code into your own git repo. Commented Apr 20, 2016 at 16:08
  • tried s3 and using userdata when spinning up new ec2 instance ? Commented Apr 20, 2016 at 16:58
  • thanks all! I have ended up convincing them using private repository Commented May 10, 2016 at 20:29

1 Answer 1

3

AWS Code Deploy service is purpose-built for code deployments like this.

AWS CodeDeploy is part of a family of AWS deployment services that includes AWS Elastic Beanstalk, AWS CodePipeline, AWS CloudFormation, and AWS OpsWorks. AWS CodeDeploy coordinates application deployments to Amazon EC2 instances, on-premises instances, or both. (On-premises instances are physical devices that are not Amazon EC2 instances.)

An application can contain deployable content like code, web, and configuration files, executables, packages, scripts, and so on. AWS CodeDeploy deploys applications from Amazon S3 buckets and GitHub repositories.

You can use any repository really. You just need a process to move the code from its repo to an designated S3 bucket. The code can be anywhere: SVN, on-premise, etc. Just zip it up, move to S3 and register the revision and deploy as needed. A GIT repository is not required, but it is directly supported by CodeDeploy.

We integrate the process with Jenkins our Continuous Integration server so all builds are sent to S3 as a CodeDeploy-ready revision.

There is no cost for using this feature when deploying to AWS instances - its free!

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for sharing this. Although I have ended up convincing them using private repository, I'm going to try code Deploy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.