summaryrefslogtreecommitdiff
path: root/app/models/concerns/deployable.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-11-15 11:19:04 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2018-11-15 11:19:04 +0000
commit09490fd0ef5717b28af3f23b85d7887c282883d7 (patch)
treed450b233ea391e92443eb890f095a444f2617871 /app/models/concerns/deployable.rb
parentb7cedd91e5ec07461b25f3920ae6cf2b00f3d84e (diff)
downloadgitlab-ce-09490fd0ef5717b28af3f23b85d7887c282883d7.tar.gz
Ignore environment validation failure
Diffstat (limited to 'app/models/concerns/deployable.rb')
-rw-r--r--app/models/concerns/deployable.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/deployable.rb b/app/models/concerns/deployable.rb
index 85db01af18d..bc12b06b5af 100644
--- a/app/models/concerns/deployable.rb
+++ b/app/models/concerns/deployable.rb
@@ -13,6 +13,10 @@ module Deployable
name: expanded_environment_name
)
+ # If we failed to persist envirionment record by validation error, such as name with invalid character,
+ # the job will fall back to a non-environment job.
+ return unless environment.persisted?
+
create_deployment!(
project_id: environment.project_id,
environment: environment,