don't deploy content types if skipped

did committed Jan 22, 2018
commit 0b9799ded99fd928bbf8f2219c451284d377d411
Showing 2 changed files with 12 additions and 4 deletions
Gemfile +2 -2
@@ @@ -12,8 +12,8 @@ gem 'rb-fsevent', '~> 0.9.1'
# gem 'duktape', github: 'judofyr/duktape.rb', ref: '20ef6a5'
# Local development
- # gem 'locomotivecms_coal', path: '../gems/coal', require: false
- # gem 'locomotivecms_steam', path: '../gems/steam', require: false
+ gem 'locomotivecms_coal', path: '../gems/coal', require: false
+ gem 'locomotivecms_steam', path: '../gems/steam', require: false
# gem 'locomotivecms_common', path: '../gems/common', require: false
group :development, :test do
locomotive/wagon/commands/push_sub_commands/push_content_entries_command.rb b/lib/locomotive/wagon/commands/push_sub_commands/push_content_entries_command.rb +10 -2
@@ @@ -16,9 +16,9 @@ module Locomotive::Wagon
def entities
@entities ||= repositories.content_type.all.map do |content_type|
# bypass a locale if there is no fields marked as localized
- next if locale? && content_type.fields.localized_names.blank?
+ next if skip_content_type?(content_type) || (locale? && content_type.fields.localized_names.blank?)
- repositories.content_entry.with(content_type).all
+ repositories.content_entry.with(content_type).all(_visible: nil)
end.compact.flatten
end
@@ @@ -79,6 +79,14 @@ module Locomotive::Wagon
other_locales.include?(self.step)
end
+ def skip_content_type?(content_type)
+ return false if @only_entities.blank?
+
+ slug = content_type.slug
+
+ !@only_entities.any? { |regexp| regexp.match(slug) }
+ end
+
end
end