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
setup_artifacts(build)
setup_build_log(build)
build.project.environments.
find_or_create_by(name: build.expanded_environment_name)
build.save
end
end
......
......@@ -78,6 +78,8 @@ module CycleAnalyticsHelpers
end
def new_dummy_job(environment)
project.environments.find_or_create_by(name: environment)
Ci::Build.new(
project: project,
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