Giter VIP home page Giter VIP logo

Comments (16)

tvaughan avatar tvaughan commented on July 22, 2024

Could you paste a copy of your config.rb here please?

from middleman-deploy.

 avatar commented on July 22, 2024
require "json"
require "slim"
require "coffee-script"
require "uglifier"

Slim::Engine.set_default_options :pretty => true

Time.zone = "Pacific Time (US & Canada)"

set :css_dir, 'css'
set :js_dir, 'js'
set :images_dir, 'images'
set :fonts_dir, 'fonts'

set :markdown_engine, :redcarpet
set :markdown, :fenced_code_blocks => true,
               :autolink => true, 
               :smartypants => true

page "humans.txt", :layout => false
page "robots.txt", :layout => false
page "/errors/404.html", :layout => false

activate :directory_indexes
activate :livereload

class FixPermissions < Middleman::Extension
  def initialize(app, options_hash={}, &block)
    super
    app.after_build do |builder|
      builder.run 'chmod 644 build/images/*'
      builder.run 'chmod 644 build/css/*'
      builder.run 'chmod 644 build/js/*'
    end
  end
end

::Middleman::Extensions.register(:fix_perm, FixPermissions)

configure :build do
  # Prep Assets for Caching
  activate :asset_hash
  activate :asset_host
  set :asset_host, "//cdn.rbg.io"

  # Minify Text
  activate :minify_css
  activate :minify_javascript

  # Compress Images
  activate :imageoptim

  # Fix Permissions
  activate :fix_perm
end

activate :deploy do |deploy|
  #deploy.build_before = true
  deploy.method = :rsync
  deploy.clean = true

  deploy.user  = ""
  deploy.port  =
  deploy.host  = ""
  deploy.path  = ""
end

from middleman-deploy.

tvaughan avatar tvaughan commented on July 22, 2024

Thanks!

Hm. Any idea how the "build" method turns that off? Or does it run during that too?

from middleman-deploy.

 avatar commented on July 22, 2024

It doesn't run during the build method. Unfortunately, I have no idea how it works, though.

from middleman-deploy.

reneruiz avatar reneruiz commented on July 22, 2024

I'm running into the same thing.

from middleman-deploy.

 avatar commented on July 22, 2024

Maybe you need to talk to the middleman-livereload guy to have it not run if it's not :development rather than if build don't do anything.

https://codeclimate.com/github/middleman/middleman-livereload/Middleman::LiveReloadExtension

from middleman-deploy.

tvaughan avatar tvaughan commented on July 22, 2024

Supposedly this has been resolved by middleman/middleman-livereload#41. Can someone else confirm this? Thanks @roundedbygravity !

from middleman-deploy.

 avatar commented on July 22, 2024

I updated my middleman-livereload gem and I'm still seeing it on deploy. Others seem to also:

middleman/middleman-livereload#41

I've even changed my config to call it this way and no dice:

configure :development do
activate :livereload
end

from middleman-deploy.

paulozoom avatar paulozoom commented on July 22, 2024

With middleman-core (3.2.2) and middleman-livereload (3.2.1), even wrapping the LiveReload activation in a configure :development block still runs LiveReload during deployment.

from middleman-deploy.

chrishough avatar chrishough commented on July 22, 2024

I am seeing the same issue, anyone find a way to fix this

from middleman-deploy.

baires avatar baires commented on July 22, 2024

Same problem here

from middleman-deploy.

parrots avatar parrots commented on July 22, 2024

I'm creating an extension to auto-open a browser window to the live reload URL in dev, and I'm seeing the same thing for my extension that you guys see for live reload. I even check to make sure the environment isn't the dev environment out of paranoia and the browser is still opened twice. (doing all the right things like only activating the plugin during dev, etc). Similar to live reload, I don't see this issue occurring during the build command, only during the deploy command.

Snipit of my paranoia:

    app.ready do |builder|
      return unless app.environment == :development
      Launchy.open("http://0.0.0.0:4567")
    end

from middleman-deploy.

tgdev avatar tgdev commented on July 22, 2024

I get the same thing and my activate :livereload is declared within a configure :development do block inside my config.rb. Commenting it out got around the issue but it's not ideal

from middleman-deploy.

jahed avatar jahed commented on July 22, 2024

Having a similar problem when trying to access Middleman::PreviewServer properties in the development configuration block.

By the looks of it, this is due to how options are retrieved through Middleman Deploy's CLI.

https://github.com/middleman-contrib/middleman-deploy/blob/master/lib/middleman-deploy/commands.rb#L62

options = ::Middleman::Application.server.inst.options

::Middleman::Application.server.inst then triggers

mm.run_hook :ready

Which will trigger the configuration block.

I'm kind of new to Ruby so I haven't looked into actually fixing it but this ticket in Middleman's repo may be relevant:
middleman/middleman#781

Here's my stacktrace:

/home/jahed/projects/jahed-io/site/config.rb:26:in `block in initialize': uninitialized constant Middleman::PreviewServer (NameError)
        from /home/jahed/.gem/ruby/gems/uber-0.0.13/lib/uber/options.rb:80:in `instance_exec'
        from /home/jahed/.gem/ruby/gems/uber-0.0.13/lib/uber/options.rb:80:in `proc!'
        from /home/jahed/.gem/ruby/gems/uber-0.0.13/lib/uber/options.rb:69:in `evaluate_for'
        from /home/jahed/.gem/ruby/gems/uber-0.0.13/lib/uber/options.rb:60:in `evaluate'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/hook.rb:53:in `execute_callback'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/hook.rb:40:in `block in run'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `each'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `inject'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in `run'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks.rb:55:in `run_hook_for'
        from /home/jahed/.gem/ruby/gems/hooks-0.4.0/lib/hooks/instance_hooks.rb:6:in `run_hook'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/extensions.rb:166:in `initialize'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/data.rb:33:in `initialize'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/application.rb:204:in `initialize'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:56:in `new'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:56:in `inst'
        from /home/jahed/.gem/ruby/gems/middleman-deploy-1.0.0/lib/middleman-deploy/commands.rb:62:in `deploy_options'
        from /home/jahed/.gem/ruby/gems/middleman-deploy-1.0.0/lib/middleman-deploy/commands.rb:36:in `build_before'
        from /home/jahed/.gem/ruby/gems/middleman-deploy-1.0.0/lib/middleman-deploy/commands.rb:29:in `deploy'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:72:in `method_missing'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/jahed/.gem/ruby/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:20:in `start'
        from /home/jahed/.gem/ruby/gems/middleman-core-3.3.12/bin/middleman:18:in `<top (required)>'
        from /home/jahed/bin/middleman:23:in `load'
        from /home/jahed/bin/middleman:23:in `<main>'

from middleman-deploy.

robertwbradford avatar robertwbradford commented on July 22, 2024

Does activate :livereload need to be moved into a :development configuration?

configure :development do
  activate :livereload
end

from middleman-deploy.

jahed avatar jahed commented on July 22, 2024

@robertwbradford We're doing that already. You can find the config.rb we're using here:

https://github.com/unruly/unruly.github.io/blob/develop/config.rb

from middleman-deploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.