diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 12:06:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 12:06:06 +0000 |
commit | fc96671f817239041ba2747af835a8d5d9aa3739 (patch) | |
tree | 19c7f650c869033760850b0d0edd4fb0a10968c4 /spec/factories | |
parent | 3d13802bc2c9400ea33defdd43bff6d904ee9c4d (diff) | |
download | gitlab-ce-fc96671f817239041ba2747af835a8d5d9aa3739.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/builds.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index c0f7948f963..0bd39d4cdcf 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -211,6 +211,17 @@ FactoryBot.define do build.project ||= build.pipeline.project end + trait :with_deployment do + after(:build) do |build, evaluator| + ## + # Build deployment/environment relations if environment name is set + # to the job. If `build.deployment` has already been set, it doesn't + # build a new instance. + build.deployment = + Gitlab::Ci::Pipeline::Seed::Deployment.new(build).to_resource + end + end + trait :tag do tag { true } end |