Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r--spec/factories/ci/builds.rb22
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