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

  • Effective DevOps with AWS
  • Yogesh Raheja Giuseppe Borgese Nathaniel Felsen
  • 408字
  • 2021-07-23 16:27:32

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, making it possible to treat our infrastructure code at the same standard as our application code (more on this in Chapter 5, 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 instead use the latter. If you don't have an account for GitHub yet, start by signing up for the service—it's completely free.

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

  1. In your browser, open https://github.com/new.
  2. Call the new repository the following: EffectiveDevOpsTemplates.
  3. Check the Initialize this repository with a README checkbox.
  4. Finally, click on the Create repository button, as shown here:

  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). For CentOS, you just need to run yum -y install git, as the Git package is a part of Linux distribution now:
$ git clone https://github.com/<your_github_username>/EffectiveDevOpsTemplates  

  1. Now that the repository is cloned, we will go into it 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 as follows:
$ git add helloworld-cf-template.py
$ git commit -m "Adding helloworld Troposphere template"
$ git push  
Monorepo versus multirepo: 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 monorepo becomes a very compelling option as it avoids juggling between multiple repositories when making big changes to your infrastructure and services simultaneously.
主站蜘蛛池模板: 东海县| 武平县| 岳池县| 巫山县| 康保县| 福鼎市| 万载县| 河源市| 秀山| 白山市| 东山县| 徐闻县| 神池县| 乐陵市| 紫阳县| 泰来县| 磐石市| 奉化市| 莒南县| 泸定县| 临城县| 屏东市| 自贡市| 嘉峪关市| 若羌县| 金山区| 襄垣县| 乌鲁木齐县| 益阳市| 苍梧县| 长沙县| 大余县| 湖口县| 莫力| 贵州省| 开阳县| 丰镇市| 屏东市| 尚志市| 宾阳县| 南通市|