fredjean / middleman-s3_sync

The gem that tries really hard not to push files to S3.
MIT License
271 stars 75 forks source link

stylesheets folder is not being synced #148

Open sarunw opened 6 years ago

sarunw commented 6 years ago

Hi

When I first use s3 everything work fine, but in my latest build stylesheet stop working. In https://github.com/fredjean/middleman-s3_sync/issues/128 you said something about sitemap I have edit stylesheet to use some scss

$main-color: #5C4EE5;

// 1. Your custom variables and variable overwrites.
$global-link-color: $main-color;
$button-primary-background: $main-color;
$form-focus-color: $main-color;
$form-focus-border: $main-color;
// 2. Import default variables and available mixins.
@import "./uikit/src/scss/variables-theme.scss";
@import "./uikit/src/scss/mixins-theme.scss";

// 3. Your custom mixin overwrites.
// @mixin hook-card() { color: #000; }

// 4. Import UIkit.
@import "./uikit/src/scss/uikit-theme.scss";

...

Don't know if this the cause.

I have tried solution in https://github.com/fredjean/middleman-s3_sync/issues/128 by switching activate :asset_hash out, but no luck.

Gemfile

# If you do not have OpenSSL installed, change
# the following line to use 'http://'
source 'https://rubygems.org'

# For faster file watcher updates on Windows:
gem 'wdm', '~> 0.1.0', platforms: [:mswin, :mingw]

# Windows does not come with time zone data
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]

# Middleman Gems
gem "middleman", "~> 4.1"
gem "middleman-blog"

gem 'redcarpet', '~> 3.3', '>= 3.3.3'

# For feed.xml.builder
gem "builder", "~> 3.0"

gem 'middleman-livereload'
gem 'middleman-s3_sync'
gem "middleman-cdn"
gem 'mime-types', '~> 3.0.0'

# Analytics
gem "middleman-google-analytics"

config.rb

# Build-specific configuration
configure :build do
  # Minify CSS on build
  activate :minify_css

  # Minify Javascript on build
  activate :minify_javascript

  activate :asset_hash
end

# http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
activate :s3_sync do |s3_sync|
  s3_sync.bucket                = xxxx
  s3_sync.region                = xxx
end

activate :cdn do |cdn|  
  cdn.cloudfront = {
    distribution_id: xxxxx
  }

  cdn.filter            = /\.html/i # default /.*/
  cdn.after_build       = true      # default is false
end

# https://middlemanapp.com/advanced/pretty-urls/
activate :directory_indexes
...

Here is result

bundle exec middleman s3_sync -v
== Activating: file_watcher
== Activating: front_matter
== Activating: data
== Activating: inline_url_rewriter
== Activating: sitemap_ondisk
== Activating: sitemap_import
== Activating: sitemap_endpoint
== Activating: sitemap_proxies
== Activating: sitemap_redirects
== Activating: sitemap_move_files
== Activating: sitemap_ignore
== Activating: external_helpers
== Activating: erb_renderer
== Activating: coffee_renderer
== Activating: haml_renderer
== Activating: sass_renderer
== Activating: markdown_renderer
== Failed Activation `liquid_renderer` : cannot load such file -- liquid
== Failed Activation `slim_renderer` : cannot load such file -- slim
== Failed Activation `less_renderer` : cannot load such file -- less
== Failed Activation `stylus_renderer` : cannot load such file -- stylus
== Activating: default_helpers
== Activating: lorem
== Activating: routing
== Activating: collections
== Change (#<Set: {:source}>): 2012-01-01-example-article.html.markdown
== Change (#<Set: {:source}>): 2017-10-25-genesis-mining.html.markdown.erb
== Change (#<Set: {:source, :no_frontmatter}>): _article_side.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _footer.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _nav.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _subscribe.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _tracking_snippet.html.erb
== Change (#<Set: {:source}>): about.html.markdown
== Change (#<Set: {:source}>): calendar.html.erb
== Change (#<Set: {:source}>): disclaimer.html.markdown
== Change (#<Set: {:source}>): feed.xml.builder
== Change (#<Set: {:source}>): images/.keep
== Change (#<Set: {:source}>): images/crypto-logo.png
== Change (#<Set: {:source}>): images/crypto-logo.svg
== Change (#<Set: {:source}>): images/favicon/android-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/android-icon-192x192.png
== Change (#<Set: {:source}>): images/favicon/android-icon-36x36.png
== Change (#<Set: {:source}>): images/favicon/android-icon-48x48.png
== Change (#<Set: {:source}>): images/favicon/android-icon-72x72.png
== Change (#<Set: {:source}>): images/favicon/android-icon-96x96.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-114x114.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-120x120.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-152x152.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-180x180.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-57x57.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-60x60.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-72x72.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-76x76.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-precomposed.png
== Change (#<Set: {:source}>): images/favicon/apple-icon.png
== Change (#<Set: {:source}>): images/favicon/browserconfig.xml
== Change (#<Set: {:source}>): images/favicon/favicon-16x16.png
== Change (#<Set: {:source}>): images/favicon/favicon-32x32.png
== Change (#<Set: {:source}>): images/favicon/favicon-96x96.png
== Change (#<Set: {:source}>): images/favicon/favicon.ico
== Change (#<Set: {:source}>): images/favicon/manifest.json
== Change (#<Set: {:source}>): images/favicon/ms-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-150x150.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-310x310.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-70x70.png
== Change (#<Set: {:source}>): index.html.erb
== Change (#<Set: {:source}>): javascripts/site.js
== Change (#<Set: {:source}>): layouts/article_layout.erb
== Change (#<Set: {:source}>): layouts/layout.erb
== Change (#<Set: {:source}>): stylesheets/site.css.scss
== Change (#<Set: {:source}>): tag.html.erb
== Rebuilding resource list
== Reading: Local config: config.rb
== Requesting resource list rebuilding: first_run_change_page
== Requesting resource list rebuilding: first_run_change_page
== Requesting resource list rebuilding: first_run_change_page
== Activating: blog
== Requesting resource list rebuilding: first_run_change_page
== Activating: s3_sync
== Activating: cdn
== Activating: directory_indexes
== Activating: google_analytics
== Activating: minify_css
== Activating: minify_javascript
== Activating: asset_hash
Loaded extensions:
== Extension: file_watcher
== Extension: front_matter
== Extension: data
== Extension: inline_url_rewriter
== Extension: sitemap_ondisk
== Extension: sitemap_import
== Extension: sitemap_endpoint
== Extension: sitemap_proxies
== Extension: sitemap_redirects
== Extension: sitemap_move_files
== Extension: sitemap_ignore
== Extension: external_helpers
== Extension: erb_renderer
== Extension: coffee_renderer
== Extension: haml_renderer
== Extension: sass_renderer
== Extension: markdown_renderer
== Extension: default_helpers
== Extension: lorem
== Extension: routing
== Extension: collections
== Extension: blog instance_0
== Extension: s3_sync
== Extension: cdn
== Extension: directory_indexes
== Extension: google_analytics
== Extension: minify_css
== Extension: minify_javascript
== Extension: asset_hash
== Change (#<Set: {:source}>): 2012-01-01-example-article.html.markdown
== Change (#<Set: {:source}>): 2017-10-25-genesis-mining.html.markdown.erb
== Change (#<Set: {:source, :no_frontmatter}>): _article_side.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _footer.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _nav.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _subscribe.html.erb
== Change (#<Set: {:source, :no_frontmatter}>): _tracking_snippet.html.erb
== Change (#<Set: {:source}>): about.html.markdown
== Change (#<Set: {:source}>): calendar.html.erb
== Change (#<Set: {:source}>): disclaimer.html.markdown
== Change (#<Set: {:source}>): feed.xml.builder
== Change (#<Set: {:source}>): images/.keep
== Change (#<Set: {:source}>): images/crypto-logo.png
== Change (#<Set: {:source}>): images/crypto-logo.svg
== Change (#<Set: {:source}>): images/favicon/android-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/android-icon-192x192.png
== Change (#<Set: {:source}>): images/favicon/android-icon-36x36.png
== Change (#<Set: {:source}>): images/favicon/android-icon-48x48.png
== Change (#<Set: {:source}>): images/favicon/android-icon-72x72.png
== Change (#<Set: {:source}>): images/favicon/android-icon-96x96.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-114x114.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-120x120.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-152x152.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-180x180.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-57x57.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-60x60.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-72x72.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-76x76.png
== Change (#<Set: {:source}>): images/favicon/apple-icon-precomposed.png
== Change (#<Set: {:source}>): images/favicon/apple-icon.png
== Change (#<Set: {:source}>): images/favicon/browserconfig.xml
== Change (#<Set: {:source}>): images/favicon/favicon-16x16.png
== Change (#<Set: {:source}>): images/favicon/favicon-32x32.png
== Change (#<Set: {:source}>): images/favicon/favicon-96x96.png
== Change (#<Set: {:source}>): images/favicon/favicon.ico
== Change (#<Set: {:source}>): images/favicon/manifest.json
== Change (#<Set: {:source}>): images/favicon/ms-icon-144x144.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-150x150.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-310x310.png
== Change (#<Set: {:source}>): images/favicon/ms-icon-70x70.png
== Change (#<Set: {:source}>): index.html.erb
== Change (#<Set: {:source}>): javascripts/site.js
== Change (#<Set: {:source}>): layouts/article_layout.erb
== Change (#<Set: {:source}>): layouts/layout.erb
== Change (#<Set: {:source}>): stylesheets/site.css.scss
== Change (#<Set: {:source}>): tag.html.erb
== Rebuilding resource list
== Requesting resource list rebuilding: touched_file
== Requesting resource list rebuilding: registered_new_manipulator_front_matter
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_ondisk
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_import
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_endpoint
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_proxies
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_redirects
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_move_files
== Requesting resource list rebuilding: registered_new_manipulator_sitemap_ignore
== Requesting resource list rebuilding: registered_new_manipulator_routing
== Requesting resource list rebuilding: registered_new_manipulator_routing
== Requesting resource list rebuilding: registered_new_manipulator_collections
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: registered_new_manipulator_blog_blog1_articles
== Requesting resource list rebuilding: first_run_change_ignore
== Requesting resource list rebuilding: registered_new_manipulator_blog_blog1_tags
== Requesting resource list rebuilding: registered_new_manipulator_blog_blog1_calendar
== Blog Sources: {year}-{month}-{day}-{title}.html (:prefix + :sources)
== Requesting resource list rebuilding: registered_new_manipulator_s3_sync
== Requesting resource list rebuilding: registered_new_manipulator_directory_indexes
== Requesting resource list rebuilding: registered_new_manipulator_asset_hash
== Rebuilding resource list
== Running manipulator: sitemap_ondisk (0)
== Running manipulator: sitemap_endpoint (0)
== Running manipulator: sitemap_proxies (0)
== Running manipulator: sitemap_redirects (0)
== Running manipulator: sitemap_ignore (0)
== Running manipulator: sitemap_import (1)
== Running manipulator: routing (10)
== Running manipulator: front_matter (20)
== Running manipulator: blog_blog1_articles (50)
== Running manipulator: blog_blog1_tags (50)
== Running manipulator: blog_blog1_calendar (50)
== Running manipulator: asset_hash (50)
== Request: /images/crypto-logo.svg
== Finishing Request: images/crypto-logo.svg (0.0s)
== Request: /javascripts/site.js
== Finishing Request: javascripts/site.js (0.0s)
== Request: /stylesheets/site.css
== Finishing Request: stylesheets/site.css (0.0s)
== Running manipulator: directory_indexes (100)
== Running manipulator: sitemap_move_files (101)
== Running manipulator: collections (110)
== Running manipulator: routing (130)
== Running manipulator: s3_sync (9999)
== Instrument (sitemap.update): 65.931641ms
{:reasons=>[:touched_file, :registered_new_manipulator_front_matter, :registered_new_manipulator_sitemap_ondisk, :registered_new_manipulator_sitemap_import, :registered_new_manipulator_sitemap_endpoint, :registered_new_manipulator_sitemap_proxies, :registered_new_manipulator_sitemap_redirects, :registered_new_manipulator_sitemap_move_files, :registered_new_manipulator_sitemap_ignore, :registered_new_manipulator_routing, :registered_new_manipulator_collections, :first_run_change_ignore, :registered_new_manipulator_blog_blog1_articles, :registered_new_manipulator_blog_blog1_tags, :registered_new_manipulator_blog_blog1_calendar, :registered_new_manipulator_s3_sync, :registered_new_manipulator_directory_indexes, :registered_new_manipulator_asset_hash]}
     s3_sync  Let's see if there's work to be done...
Processing sitemap |Time: 00:00:00 | ========================== | Time: 00:00:00
Processing remote files |Time: 00:00:00 | ===================== | Time: 00:00:00
     s3_sync  All S3 files are up to date.
sarunw commented 6 years ago

Tried it on local and work fine.

s3_sync  Let's see if there's work to be done...
Processing sitemap |Time: 00:00:13 | ========================== | Time: 00:00:13
Processing remote files |Time: 00:00:00 | ===================== | Time: 00:00:00

Processing sitemap take sometime, but on circleci take 0 second

s3_sync  Let's see if there's work to be done...
Processing sitemap |Time: 00:00:00 | ========================== | Time: 00:00:00
Processing remote files |Time: 00:00:00 | ===================== | Time: 00:00:00
mib32 commented 4 years ago

Same for me

johnclittle commented 4 years ago

This happens for me as well. Only when I enable activate :asset_hash