[deploy] Feature:Add ENV to Skip Fastly Config Update (#10251)

This commit is contained in:
Molly Struve 2020-09-08 13:11:12 -05:00 committed by GitHub
parent 5406ec9ab9
commit 6eed518404
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,21 @@
namespace :fastly do
desc "Update Fastly configs"
task update_configs: :environment do
fastly_credentials = %w[
FASTLY_API_KEY
FASTLY_SERVICE_ID
]
unless ENV["SKIP_FASTLY_CONFIG_UPDATE"] == "true"
fastly_credentials = %w[
FASTLY_API_KEY
FASTLY_SERVICE_ID
]
if fastly_credentials.any? { |cred| ApplicationConfig[cred].blank? }
Rails.logger.info(
"Fastly not configured. Please set #{fastly_credentials.join(', ')} in your environment.",
)
if fastly_credentials.any? { |cred| ApplicationConfig[cred].blank? }
Rails.logger.info(
"Fastly not configured. Please set #{fastly_credentials.join(', ')} in your environment.",
)
next
next
end
FastlyConfig::Update.call
end
FastlyConfig::Update.call
end
end