Skip to content

Add EC2 to AutoDevOps template

Etienne Baqué requested to merge 216008-ec2-for-auto-deploy into master

What does this MR do?

This MR modifies Auto-Build (Build.gitlab-ci.yml), asking the user to create their own build job (named build_artifact) so that AutoDevOps for EC2 deployment can be fully enabled.

Screenshots

Prerequisites: AUTO_DEVOPS_PLATFORM_TARGET is set to EC2.

Sample project with a 'build_artifact' job

.gitlab-ci.yml file of sample project: https://gitlab.com/ebaque/jekyll-demo/-/blob/deploy-to-ec2/.gitlab-ci.yml

build_artifact:
  stage: build
  image: ruby:2.3
  before_script:
    - bundle install
  script:
    - bundle exec jekyll build -d public
  artifacts:
    paths:
      - public

Pipeline: https://gitlab.com/ebaque/jekyll-demo/-/pipelines/210615125

Screenshot_from_2020-11-02_14-23-56

Sample project without any defined 'build_artifact' job

Pipeline: https://gitlab.com/ebaque/jekyll-demo/-/pipelines/210619953 Without a build_artifact job, and after triggering a pipeline, the build stage fails with the following error message:

Screenshot_from_2020-11-02_14-27-15

Failed job: https://gitlab.com/ebaque/jekyll-demo/-/pipelines/210615125

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #216008 (closed)

Edited by Etienne Baqué

Merge request reports