Comments (16)
Could you paste a copy of your config.rb here please?
from middleman-deploy.
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.
Thanks!
Hm. Any idea how the "build" method turns that off? Or does it run during that too?
from middleman-deploy.
It doesn't run during the build method. Unfortunately, I have no idea how it works, though.
from middleman-deploy.
I'm running into the same thing.
from middleman-deploy.
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.
Supposedly this has been resolved by middleman/middleman-livereload#41. Can someone else confirm this? Thanks @roundedbygravity !
from middleman-deploy.
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.
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.
I am seeing the same issue, anyone find a way to fix this
from middleman-deploy.
Same problem here
from middleman-deploy.
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.
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.
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.
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.
Does activate :livereload
need to be moved into a :development configuration?
configure :development do
activate :livereload
end
from middleman-deploy.
@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)
- README: 'deploy_method' should be 'deploy' HOT 5
- Local changes would be overwritten by checkout
- CNAME gets blown out with force update HOT 4
- `block in initialize': undefined method `deploy_method=' for #<Middleman::Deploy
- Can't deploy to remote HOT 1
- Deploy build directory to github pages? HOT 7
- Git Force-Push Deploy Pushes Root Instead of Build Dir HOT 18
- undefined method "deploy_method" HOT 7
- Compatibility with Middleman 4.1.7 HOT 4
- Deploy path doesn't work for Git Deploy Method HOT 1
- Rsync: Configured username ignored HOT 4
- Forceful deploy cause long upload times
- deploy.user not being set HOT 1
- Error with Middleman 4.2 and middleman-deploy 1.0 HOT 16
- deploy.deploy_method has changed to method HOT 1
- How to deploy robots.txt file HOT 1
- Ubuntu 18.04 rsync method fails
- Support additional commands during deploy
- Feature Request: support a different trunk branch HOT 1
- Is this gem abandoned? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middleman-deploy.