Make sure that environment was created before deploying

This commit is contained in:
Lin Jen-Shin 2017-06-02 21:00:56 +08:00
parent 3731ae092c
commit 4968f226a0
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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,