From 07ecb2509bd9a351a17b304f80a14f9feb3f2bc4 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 23 Oct 2018 18:26:23 +0200 Subject: [PATCH] case --- lib/tasks/deploy.rake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake index 1f4b0c157..490ff5f99 100644 --- a/lib/tasks/deploy.rake +++ b/lib/tasks/deploy.rake @@ -1,8 +1,11 @@ task :deploy do - if ENV['STAGE_NAME'] == 'dev' - domains = ['web1.dev', 'web2.dev'] - elsif ENV['STAGE_NAME'] == 'master' - domains = ['web1', 'web2'] + domains = case ENV['STAGE_NAME'] + when 'dev' + ['web1.dev', 'web2.dev'] + when 'master' + ['web1', 'web2'] + else + raise "STAGE_NAME #{STAGE_NAME} is unknown. It must be either dev or master" end branch = ENV['STAGE_NAME']