diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/factories/ci/builds.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r-- | spec/factories/ci/builds.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 0e535aeaa8d..f3500301e22 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -120,6 +120,19 @@ FactoryBot.define do end end + trait :environment_with_deployment_tier do + environment { 'test_portal' } + options do + { + script: %w(ls), + environment: { name: 'test_portal', + action: 'start', + url: 'http://staging.example.com/$CI_JOB_NAME', + deployment_tier: 'testing' } + } + end + end + trait :deploy_to_production do environment { 'production' } @@ -224,8 +237,13 @@ FactoryBot.define do # to the job. If `build.deployment` has already been set, it doesn't # build a new instance. environment = Gitlab::Ci::Pipeline::Seed::Environment.new(build).to_resource - build.deployment = - Gitlab::Ci::Pipeline::Seed::Deployment.new(build, environment).to_resource + + build.assign_attributes( + deployment: Gitlab::Ci::Pipeline::Seed::Deployment.new(build, environment).to_resource, + metadata_attributes: { + expanded_environment_name: environment.name + } + ) end end |