Commit 4968f226 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure that environment was created before deploying

parent 3731ae09
...@@ -112,6 +112,10 @@ class Gitlab::Seeder::Pipelines ...@@ -112,6 +112,10 @@ class Gitlab::Seeder::Pipelines
setup_artifacts(build) setup_artifacts(build)
setup_build_log(build) setup_build_log(build)
build.project.environments.
find_or_create_by(name: build.expanded_environment_name)
build.save build.save
end end
end end
......
...@@ -78,6 +78,8 @@ module CycleAnalyticsHelpers ...@@ -78,6 +78,8 @@ module CycleAnalyticsHelpers
end end
def new_dummy_job(environment) def new_dummy_job(environment)
project.environments.find_or_create_by(name: environment)
Ci::Build.new( Ci::Build.new(
project: project, project: project,
user: user, user: user,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment