Help us learn about your current experience with the documentation. Take the survey.

使用 Auto DevOps 部署到 EC2

要使用 Auto DevOps 部署到 EC2:

  1. 您的 AWS 凭据定义为 CI/CD 变量

  2. 在您的 .gitlab-ci.yml 文件中,引用 Auto-Devops.gitlab-ci.yml 模板。

  3. 为名为 build_artifactbuild 阶段定义一个作业。例如:

    # .gitlab-ci.yml
    
    include:
      - template: Auto-DevOps.gitlab-ci.yml
    
    variables:
      AUTO_DEVOPS_PLATFORM_TARGET: EC2
    
    build_artifact:
      stage: build
      script:
        - <your build script goes here>
      artifacts:
        paths:
          - <built artifact>

有关此过程的视频教程,请查看 自动部署到 EC2