diff --git a/changelogs/unreleased/220821-remove-deprecated-ecs-template.yml b/changelogs/unreleased/220821-remove-deprecated-ecs-template.yml new file mode 100644 index 0000000000000000000000000000000000000000..062514a1ca645d375c74b4bdc28606b76404d75c --- /dev/null +++ b/changelogs/unreleased/220821-remove-deprecated-ecs-template.yml @@ -0,0 +1,5 @@ +--- +title: Deprecation of ECS template +merge_request: 36143 +author: +type: deprecated diff --git a/doc/ci/cloud_deployment/index.md b/doc/ci/cloud_deployment/index.md index 29ce8bdf6250eacd309bce6adecf4f0dcab91f0f..a2dea5006cac504a05ade8a1667806fa11c6f7d4 100644 --- a/doc/ci/cloud_deployment/index.md +++ b/doc/ci/cloud_deployment/index.md @@ -81,11 +81,12 @@ path to point to your ECR image. ### Deploy your application to the AWS Elastic Container Service (ECS) -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/207962) in GitLab 12.9. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/207962) in GitLab 12.9. +> - The `Deploy-ECS.gitlab-ci.yml` template was deprecated in favor of `AWS/Deploy-ECS.gitlab-ci.yml` template in GitLab 13.2. GitLab provides a series of [CI templates that you can include in your project](../yaml/README.md#include). To automate deployments of your application to your [Amazon Elastic Container Service](https://aws.amazon.com/ecs/) (AWS ECS) -cluster, you can `include` the `Deploy-ECS.gitlab-ci.yml` template in your `.gitlab-ci.yml` file. +cluster, you can `include` the `AWS/Deploy-ECS.gitlab-ci.yml` template in your `.gitlab-ci.yml` file. GitLab also provides [Docker images](https://gitlab.com/gitlab-org/cloud-deploy/-/tree/master/aws) that can be used in your `gitlab-ci.yml` file to simplify working with AWS: @@ -129,7 +130,7 @@ After you're all set up on AWS ECS, follow these steps: - template: AWS/Deploy-ECS.gitlab-ci.yml ``` - The `Deploy-ECS` template ships with GitLab and is available [on + The `AWS/Deploy-ECS` template ships with GitLab and is available [on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml). 1. Commit and push your updated `.gitlab-ci.yml` to your project's repository, and you're done! @@ -143,17 +144,17 @@ After you're all set up on AWS ECS, follow these steps: application. CAUTION: **Warning:** -The [`Deploy-ECS.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml) +The [`AWS/Deploy-ECS.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml) template includes both the [`Jobs/Build.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml) and [`Jobs/Deploy/ECS.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml) "sub-templates". Do not include these "sub-templates" on their own, and only include the main -`Deploy-ECS.gitlab-ci.yml` template. The "sub-templates" are designed to only be +`AWS/Deploy-ECS.gitlab-ci.yml` template. The "sub-templates" are designed to only be used along with the main template. They may move or change unexpectedly causing your pipeline to fail if you didn't include the main template. Also, the job names within these templates may change. Do not override these jobs names in your own pipeline, as the override will stop working when the name changes. -Alternatively, if you don't wish to use the `Deploy-ECS.gitlab-ci.yml` template +Alternatively, if you don't wish to use the `AWS/Deploy-ECS.gitlab-ci.yml` template to deploy to AWS ECS, you can always use our `aws-base` Docker image to run your own [AWS CLI commands for ECS](https://docs.aws.amazon.com/cli/latest/reference/ecs/index.html#cli-aws-ecs). diff --git a/lib/gitlab/ci/templates/Deploy-ECS.gitlab-ci.yml b/lib/gitlab/ci/templates/Deploy-ECS.gitlab-ci.yml index 5f4bd631db6bd4749730b2d5f28bbaa184f9e302..c1815baf7e6609cf8642cee330a0046735164e7c 100644 --- a/lib/gitlab/ci/templates/Deploy-ECS.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Deploy-ECS.gitlab-ci.yml @@ -1,4 +1,4 @@ -# This template is deprecated and will be removed as part of GitLab 13.2! +# This template is deprecated. # # If you have referenced this template in your CI pipeline, please # update your CI configuration by replacing the following occurrence(s): @@ -20,12 +20,8 @@ stages: - deploy - production -before_script: - - printf '\nWARNING!\nThis job includes "Deploy-ECS.gitlab-ci.yml". Please rename this to "AWS/Deploy-ECS.gitlab-ci.yml".\n' - -variables: - AUTO_DEVOPS_PLATFORM_TARGET: ECS - -include: - - template: Jobs/Build.gitlab-ci.yml - - template: Jobs/Deploy/ECS.gitlab-ci.yml +"error: Template has moved": + stage: deploy + script: + - echo "Deploy-ECS.gitlab-ci.yml has been moved to AWS/Deploy-ECS.gitlab-ci.yml, see https://docs.gitlab.com/ee/ci/cloud_deployment/#deploy-your-application-to-the-aws-elastic-container-service-ecs for more details." + - exit 1 diff --git a/qa/Gemfile b/qa/Gemfile index e2951db534a02a92dd3bde8cfe9f429abd14402e..cf9c63c5958a9484c5759ff68faf9e1ee113d3a9 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -16,6 +16,7 @@ gem 'faker', '~> 1.6', '>= 1.6.6' gem 'knapsack', '~> 1.17' gem 'parallel_tests', '~> 2.29' gem 'rotp', '~> 3.1.0' +gem 'rspec-parameterized', '~> 0.4.2' group :test do gem 'pry-byebug', '~> 3.5.1', platform: :mri diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index c2b876e3b044b912725211bfb635616b539c3712..c6baa49a4c391e99cc0d1c148223aa451614f380 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -1,12 +1,16 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.1) + abstract_type (0.0.7) + activesupport (6.0.3.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) airborne (0.3.4) @@ -15,6 +19,8 @@ GEM rack-test (>= 1.1.0, < 2.0) rest-client (>= 2.0.2, < 3.0) rspec (~> 3.8) + ast (2.4.1) + binding_ninja (0.2.3) byebug (9.1.0) capybara (3.29.0) addressable @@ -24,55 +30,93 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - capybara-screenshot (1.0.23) + capybara-screenshot (1.0.24) capybara (>= 1.0, < 4) launchy childprocess (3.0.0) - coderay (1.1.2) + coderay (1.1.3) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) concurrent-ruby (1.1.6) debase (0.2.4.1) debase-ruby_core_source (>= 0.10.2) - debase-ruby_core_source (0.10.6) - diff-lcs (1.3) + debase-ruby_core_source (0.10.9) + diff-lcs (1.4.4) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - faker (1.9.3) + equalizer (0.0.11) + faker (1.9.6) i18n (>= 0.7) - gitlab-qa (4.0.0) + ffi (1.13.1) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake + gitlab (4.11.0) + httparty (~> 0.14, >= 0.14.0) + terminal-table (~> 1.5, >= 1.5.1) + gitlab-qa (5.15.0) + activesupport (~> 6.0.2) + gitlab (~> 4.11.0) + http (= 4.3.0) + nokogiri (~> 1.10) + table_print (= 1.5.6) + http (4.3.0) + addressable (~> 2.3) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + http-parser (~> 1.2.0) http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.8.2) + http-form_data (2.3.0) + http-parser (1.2.1) + ffi-compiler (>= 1.0, < 2.0) + httparty (0.18.1) + mime-types (~> 3.0) + multi_xml (>= 0.5.2) + i18n (1.8.3) concurrent-ruby (~> 1.0) - knapsack (1.17.1) + ice_nine (0.11.2) + knapsack (1.18.0) rake - launchy (2.4.3) - addressable (~> 2.3) - method_source (0.9.0) + launchy (2.5.0) + addressable (~> 2.7) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.0425) + mime-types-data (3.2020.0512) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.1) + multi_xml (0.6.0) netrc (0.11.0) - nokogiri (1.10.9) + nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - parallel (1.17.0) - parallel_tests (2.29.0) + parallel (1.19.2) + parallel_tests (2.32.0) parallel - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) + parser (2.7.1.4) + ast (~> 2.4.1) + proc_to_ast (0.1.0) + coderay + parser + unparser + procto (0.0.3) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) pry-byebug (3.5.1) byebug (~> 9.1) pry (~> 0.10) - public_suffix (4.0.1) - rack (2.2.2) + public_suffix (4.0.5) + rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - rake (12.3.0) - regexp_parser (1.6.0) + rake (12.3.3) + regexp_parser (1.7.1) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -85,23 +129,32 @@ GEM rspec-mocks (~> 3.9.0) rspec-core (3.9.2) rspec-support (~> 3.9.3) - rspec-expectations (3.9.1) + rspec-expectations (3.9.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) - rspec-retry (0.6.1) + rspec-parameterized (0.4.2) + binding_ninja (>= 0.2.3) + parser + proc_to_ast + rspec (>= 2.13, < 4) + unparser + rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.9.3) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) ruby-debug-ide (0.7.2) rake (>= 0.8.1) - rubyzip (1.3.0) - selenium-webdriver (3.142.6) + rubyzip (2.3.0) + selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) + table_print (1.5.6) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) timecop (0.9.1) tzinfo (1.2.7) @@ -109,9 +162,18 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.7) + unicode-display_width (1.7.0) + unparser (0.4.7) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.3) + equalizer (~> 0.0.9) + parser (>= 2.6.5) + procto (~> 0.0.2) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.3.0) + zeitwerk (2.3.1) PLATFORMS ruby @@ -132,6 +194,7 @@ DEPENDENCIES rest-client (~> 2.1.0) rotp (~> 3.1.0) rspec (~> 3.7) + rspec-parameterized (~> 0.4.2) rspec-retry (~> 0.6.1) rspec_junit_formatter (~> 0.4.1) ruby-debug-ide (~> 0.7.0) diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/auto_devops_templates_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/auto_devops_templates_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..11656afe0def8b1a8850e1929c78d664c9a86b6d --- /dev/null +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/auto_devops_templates_spec.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Configure' do + describe 'AutoDevOps Templates', only: { subdomain: :staging } do + let(:optional_jobs) do + %w[ + LICENSE_MANAGEMENT_DISABLED + SAST_DISABLED DAST_DISABLED + DEPENDENCY_SCANNING_DISABLED + CONTAINER_SCANNING_DISABLED + ] + end + + where(:template) do + %w[rails spring express] + end + + with_them do + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = "#{template}-autodevops-project-template" + project.template_name = template + project.description = "Let's see if the #{template} project works..." + project.auto_devops_enabled = true + end + end + + let(:pipeline) do + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = project + pipeline.variables = + optional_jobs.map do |job| + { key: job, value: '1', variable_type: 'env_var' } + end + end + end + + before do + Flow::Login.sign_in + end + + it 'works with Auto DevOps' do + %w[build test].each do |job| + pipeline.visit! + + Page::Project::Pipeline::Show.perform do |show_page| + show_page.click_job(job) + end + + Page::Project::Job::Show.perform do |show| + expect(show).to have_passed(timeout: 360) + end + end + end + end + end + end +end diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index 0f818b9f89a062a4e42aec27b2743ab5ea3ce47b..b3251c739a9f534fd2277f8438308f78fb729b91 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -2,6 +2,7 @@ require_relative '../qa' require 'rspec/retry' +require 'rspec-parameterized' if ENV['CI'] && QA::Runtime::Env.knapsack? && !ENV['NO_KNAPSACK'] require 'knapsack'