官术网_书友最值得收藏!

Adding our template to a source control system

Now that we have tested our template and know it's working, we are going to commit it to our source control system. This will allow us to keep track of changes and gives the ability to treat our infrastructure code up to the same standard as our application code. (There is more on that in Chapter 4, Adding Continuous Integration and Continuous Deployment.)

To do that, we will rely on Git. AWS has a service called AWS CodeCommit (http://amzn.to/2tKUj0n), which lets you manage Git repositories easily; however, because this service is a lot less popular than GitHub (https://github.com), we will use the latter instead. If you don't have an account for GitHub yet, start by signing up for the service (it's completely free).

Once logged in to GitHub, create a new repository for the CloudFormation template:

  1. In your browser, open https://github.com/new.
  2. Call the new repository EffectiveDevOpsTemplates.
  3. Check the checkbox Initialize this repository with a README.
  4. Finally, click the Create repository button:
  1. Once your repository is created, you will want to clone it into your computer. For that, you need to have Git installed. (Search on Google for instructions on how to install Git for your operating system if you don't have it yet):
$ git clone https://github.com/<your_github_username>/EffectiveDevOpsTemplates  
  1. Now that the repository is cloned, we will go into the repository and copy the template previously created in the new GitHub repository:
$ cd EffectiveDevOpsTemplates
$ cp <path_to_helloworld_template>/helloworld-cf-template.py .  
  1. Finally, we will add and commit that new file to our project and push it to GitHub:
$ git add helloworld-cf-template.py
$ git commit -m "Adding helloworld Troposphere template"
$ git push  
Mono repos versus multi repos
When managing your code, there are two common approaches to organizing your code repositories. You can create one repository for each project you have or decide to put your entire organization code under a single repository. We will choose the simplest option for this book, which is one repository per project but with the recent releases of several open source projects such as Bazel from Google, Buck from Facebook, or Pants from Twitter, using a mono repo becomes a very compelling option as it avoids juggling between multiple repositories when making big changes in your infrastructure and services at the same time.
主站蜘蛛池模板: 澄城县| 新乡县| 台南市| 松溪县| 永修县| 永安市| 寿阳县| 遂宁市| 祁东县| 金秀| 鲁山县| 武义县| 泸水县| 莲花县| 威宁| 桂东县| 洛隆县| 同江市| 楚雄市| 永济市| 融水| 崇文区| 垦利县| 无棣县| 墨脱县| 东港市| 枝江市| 潮州市| 聂拉木县| 临江市| 和顺县| 三原县| 蕉岭县| 邛崃市| 新津县| 巴东县| 庆云县| 西畴县| 富顺县| 呼玛县| 安新县|