Tạo deployment group

Tạo deployment group

  1. Cấu trúc file để triển khai:
/tmp/
  |--WordPress/
      |-- appspec.yml  
      |-- scripts/
      |    |-- change_permissions.sh
      |    |-- create_test_db.sh
      |    |-- install_dependencies.sh
      |    |-- start_server.sh
      |    |-- stop_server.sh
      |-- wp-admin/
      |    |-- (various files...)
      |-- wp-content/
      |    |-- (various files...)
      |-- wp-includes/
      |    |-- (various files...)
      |-- index.php
      |-- license.txt
      |-- readme.html
      |-- (various files ending with .php...)
  • Thực hiện tạo application cho CodeDeploy:
cd /tmp/WordPress
aws deploy create-application --application-name WordPress_App
  • Bạn phải cấu hình CLI để sử dụng lệnh.

CodeDeploy

  1. Thực hiện upload revision của CodeDeploy lên Amazon S3.
aws deploy push \
  --application-name WordPress_App \
  --s3-location s3://bucketname/WordPressApp.zip \
  --ignore-hidden-files
  • Kiểm tra S3 bucket xem kết quả push.

CodeDeploy

  1. Truy cập giao diện CodeDeploy

    • Chọn Applications
    • Chọn WordPress_App

CodeDeploy

  1. Trong giao diện Applicaiton

    • Chọn Deployment groups
    • Chọn Create deployment group

CodeDeploy

  1. Nhập deployment group name. Chọn Service role.

CodeDeploy

  1. Đối với Deployment type
  • Chọn In-place
  • Environment configuration, chọn Amazon EC2 instances
  • Nhập key
  • Nhập value.

CodeDeploy

  1. Chọn DeploymentCodeDeployDefault.OneAtATime
  • Chọn Create deployment group

CodeDeploy

  1. Tạo deployment group thành công.

CodeDeploy