Giter VIP home page Giter VIP logo

middleman-deploy's Introduction

Middleman Deploy

Deploy your Middleman build via rsync, ftp, sftp, or git (e.g. gh-pages on github).

Installation

gem 'middleman-deploy', '~> 1.0'

Usage

$ middleman build [--clean]
$ middleman deploy [--build-before]

Possible Configurations

Middleman-deploy can deploy a site via rsync, ftp, sftp, or git. Checkout the wiki for advanced set-up options.

Rsync

Make sure that rsync is installed, and activate the extension by adding the following to config.rb:

activate :deploy do |deploy|
  deploy.method = :rsync
  deploy.host          = 'www.example.com'
  deploy.path          = '/srv/www/site'
  # Optional Settings
  # deploy.user  = 'tvaughan' # no default
  # deploy.port  = 5309 # ssh port, default: 22
  # deploy.clean = true # remove orphaned files on remote host, default: false
  # deploy.flags = '-rltgoDvzO --no-p --del' # add custom flags, default: -avz
end

Git (e.g. GitHub Pages)

Make sure that git is installed, and activate the extension by adding the following to config.rb:

activate :deploy do |deploy|
  deploy.method = :git
  # Optional Settings
  # deploy.remote   = 'custom-remote' # remote name or git url, default: origin
  # deploy.branch   = 'custom-branch' # default: gh-pages
  # deploy.strategy = :submodule      # commit strategy: can be :force_push or :submodule, default: :force_push
  # deploy.commit_message = 'custom-message'      # commit message (can be empty), default: Automated commit at `timestamp` by middleman-deploy `version`
end

If you use a remote name, you must first add it using git remote add. Run git remote -v to see a list of possible remote names. If you use a git url, it must end with '.git'.

Afterwards, the build directory will become a git repo.

If you use the force push strategy, this branch will be created on the remote if it doesn't already exist. But if you use the submodule strategy, you must first initialize build folder as a submodule. See git submodule add documentation.

FTP

Activate the extension by adding the following to config.rb:

activate :deploy do |deploy|
  deploy.method   = :ftp
  deploy.host            = 'ftp.example.com'
  deploy.path            = '/srv/www/site'
  deploy.user            = 'tvaughan'
  deploy.password        = 'secret'
end

SFTP

Activate the extension by adding the following to config.rb:

activate :deploy do |deploy|
  deploy.method   = :sftp
  deploy.host            = 'sftp.example.com'
  deploy.port            = 22
  deploy.path            = '/srv/www/site'
  # Optional Settings
  # deploy.user     = 'tvaughan' # no default
  # deploy.password = 'secret' # no default
end

Run Automatically

To automatically run middleman build during middleman deploy, turn on the build_before option while activating the deploy extension:

activate :deploy do |deploy|
  # ...
  deploy.build_before = true # default: false
end

Multiple Environments

Deploy your site to more than one configuration using environment variables.

# config.rb
case ENV['TARGET'].to_s.downcase
when 'production'
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host            = 'www.example.com'
    deploy.path            = '/srv/www/production-site'
  end
else
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host            = 'staging.example.com'
    deploy.path            = '/srv/www/staging-site'
  end
end
# Rakefile
namespace :deploy do
  def deploy(env)
    puts "Deploying to #{env}"
    system "TARGET=#{env} bundle exec middleman deploy"
  end

  task :staging do
    deploy :staging
  end

  task :production do
    deploy :production
  end
end
$ rake deploy:staging
$ rake deploy:production

Badges

Gem Version Build Status Code Quality Code Coverage Gittip

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

Credits

A BIG thanks to everyone who has contributed! Almost all pull requests are accepted.

Inspiration:

middleman-deploy's People

Contributors

5t111111 avatar bencates avatar bzalasky avatar carrete avatar cveneziani avatar danielbayerlein avatar derek-watson avatar emilioforrer avatar flyerhzm avatar gee-bee avatar grossws avatar jakeprem avatar jasonsemko avatar jm3 avatar karlfreeman avatar lyonsinbeta avatar mconnell avatar msch avatar narkoz avatar nulltask avatar philippbosch avatar reefab avatar rmm5t avatar statonjr avatar tvaughan avatar whitetrefoil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

middleman-deploy's Issues

Cant deploy to multiple Env

Im under a load balancing env so I need to run several deploys at once

This is my config

#config.ru
case ENV['TARGET'].to_s.downcase
when 'production1'
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host   = 'static-prod'
    deploy.clean = true
  end
when 'production2'
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host   = 'static-prod2'
    deploy.clean = true
end
when 'staging'
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host   = 'static-dev'
    deploy.clean = true
  end
end
#Rakefile
namespace :deploy do
  def deploy(env)
    puts "Deploying to #{env}"
    system "TARGET=#{env} bundle exec middleman deploy"
  end

  task :staging do
    deploy :staging
  end

  task :production1 do
    deploy :production1
  end

  task :production2 do
    deploy :production2
  end
end

When I ran rake deploy:production1 its prints Deploying to production1 but nothing happens. Although if I ran TARGET=production1 bundle exec middleman deploy its works.

Any idea?

middleman-deploy breaks the building and the server operations (on windows)

Hi!

Just by adding the line
gem "middleman-deploy"
in the Gemfile, the "bundle exec middleman build" command breaks down and the middleman server gives the browser a "File not font" error.

Gemfile:

source 'http://rubygems.org'
gem "middleman", ">3.3.3"
gem "middleman-livereload", "
> 3.1.0"
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
gem "tzinfo-data", platforms: [:mswin, :mingw]
gem "slim"
gem "jquery-middleman"
gem "compass-rgbapng"
gem "bootstrap-sass", require: false
gem "middleman-favicon-maker"
gem "middleman-smusher"
gem "middleman-deploy"

The error at build is this:

C:\Sites\eg2016>bundle exec middleman build
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/pathname.rb:48:in []': no implicit conversion from nil to integer (TypeError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/pathname.rb:48:inchop_basename'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/pathname.rb:101:in cleanpath_aggressive' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/pathname.rb:89:incleanpath'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/pathname.rb:451:in relative_path_from' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/cli/build.rb:193:inexecute!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/cli/build.rb:128:in invoke!' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/actions.rb:94:inaction'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/cli/build.rb:70:in build' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:indispatch'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/cli.rb:72:inmethod_missing'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:29:in run' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:126:inrun'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:indispatch'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/cli.rb:20:instart'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/bin/middleman:18:in <top (required)>' from C:/RailsInstaller/Ruby1.9.3/bin/middleman:23:inload'
from C:/RailsInstaller/Ruby1.9.3/bin/middleman:23:in `

'

C:\Sites\eg2016>

And the middleman server gives this page, although it starts without errors and does not show any error when the browsers asks for the page

File Not Found

/

Default Port

I've been using middleman-deploy for sometime now and it hasn't failed me. For the past 24 hours I've failed to find a way to not provide the default port of 22 while using the rsync configuration. My config looks like so:

activate :deploy do |deploy|
  deploy.method         = :rsync
  deploy.flags             = "-avv --progress"
  deploy.host              = "example"
  deploy.path              = "/web/"
  deploy.user              = "example_user"
  # deploy.port            = false
  deploy.clean             = "true"
end

The deploy.host file points to my /.ssh/config which uses my private key. I've tried the following to get the port not to be called:

deploy.port = false
deploy.port = ""
deploy.port = "false"
and also no deploy.port setting at all but when I run it I get

Deploying via rsync to [email protected]:/web/ port=22

Thinking of the simplest way to do this, can someone showeth thou thy way :) - Thanks in advance!

ptools has to be installed for middleman-deploy to work on windows

I am facing the following error with ptools:

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/methods/ftp.rb:2:in
`require': cannot load such file -- ptools (LoadError)
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/methods/ftp.rb:2:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/methods.rb:2:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/methods.rb:2:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/commands.rb:5:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy/commands.rb:5:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy.rb:3:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-deploy-1.0.0/lib/middleman-deploy.rb:3:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `each'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `block in require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `each'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.12/lib/bundler.rb:134:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-core-3.3.7/lib/middlemancore/load_paths.rb:37:in `setup_load_paths'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/middleman-core-3.3.7/bin/middleman:10:in `<top(required)>'
        from C:/Ruby21-x64/bin/middleman:23:in `load'
        from C:/Ruby21-x64/bin/middleman:23:in `<main>'

If we are using only GitHub Pages and deploying via git, could we make it optional to have to install stuff to deploy via FTP? Outputing a warning maybe. What do you guys think?

SFTP with a certificate

I'm only using SSH with certificates, not passwords. After seeing 6eed387 I assumed it's possible to use a certificate, but I don't understand how I should reference it in the configuration?

My regular SCP call looks something like this: scp -c 3des -2 -i ~/foo.pem -p 22 somefile ubuntu@$HOSTNAME:/home/ubuntu/

Missing dependency for rsync deploy

I am new to ruby. Where is the run command? This is the piece of code causing the error, in middleman-deploy/methods/rsync.rb:

module Middleman
  module Deploy
    module Methods
      class Rsync < Base

        attr_reader :clean, :flags, :host, :path, :port, :user

        def initialize(server_instance, options={})
          super(server_instance, options)

          @clean  = self.options.clean
          @flags  = self.options.flags
          @host   = self.options.host
          @path   = self.options.path
          @port   = self.options.port
          @user   = self.options.user
        end

        def process
          # Append "@" to user if provided.
          user      = "#{self.user}@" if self.user && !self.user.empty?

          dest_url  = "#{user}#{self.host}:#{self.path}"
          flags     = self.flags || '-avz'
          command   = "rsync #{flags} '-e ssh -p #{self.port}' #{self.server_instance.build_dir}/ #{dest_url}"

          if self.clean
            command += " --delete"
          end

          puts "## Deploying via rsync to #{dest_url} port=#{self.port}"
          run command
        end

      end
    end
  end
end

This is the error:

Deploying to tethys
## Deploying via rsync to tethys.xxx.net:/www/production-site port=55555
/home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-deploy-0.2.2/lib/middleman-deploy/methods/rsync.rb:32:in `process': undefined method `run' for #<Middleman::Deploy::Methods::Rsync:0xb92136d0> (NoMethodError)
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-deploy-0.2.2/lib/middleman-deploy/commands.rb:59:in `process'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-deploy-0.2.2/lib/middleman-deploy/commands.rb:31:in `deploy'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core-3.0.14/lib/middleman-core/cli.rb:77:in `method_missing'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/task.rb:29:in `run'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/task.rb:126:in `run'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core-3.0.14/lib/middleman-core/cli.rb:22:in `start'
    from /home/gonvaled/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core-3.0.14/bin/middleman:18:in `<top (required)>'
    from /home/gonvaled/.rbenv/versions/2.1.0/bin/middleman:23:in `load'
    from /home/gonvaled/.rbenv/versions/2.1.0/bin/middleman:23:in `<main>'

My bundle:

gonvaled@pegasus ~/tmp/xxx (master)» bundle list
Gems included by the bundle:
  * activesupport (3.2.13)
  * bundler (1.5.3)
  * chunky_png (1.2.8)
  * coffee-script (2.2.0)
  * coffee-script-source (1.3.3)
  * compass (0.12.2)
  * execjs (1.4.0)
  * ffi (1.9.0)
  * fssm (0.2.10)
  * haml (4.0.3)
  * hike (1.2.3)
  * http_router (0.10.2)
  * i18n (0.6.1)
  * listen (0.7.3)
  * maruku (0.6.1)
  * middleman (3.0.14)
  * middleman-core (3.0.14)
  * middleman-deploy (0.2.2)
  * middleman-more (3.0.14)
  * middleman-sprockets (3.1.4)
  * multi_json (1.8.0)
  * net-sftp (2.1.2)
  * net-ssh (2.8.0)
  * padrino-core (0.10.7)
  * padrino-helpers (0.10.7)
  * ptools (1.2.3)
  * rack (1.4.5)
  * rack-protection (1.5.0)
  * rack-test (0.6.2)
  * rb-fsevent (0.9.3)
  * rb-inotify (0.9.2)
  * sass (3.2.11)
  * sinatra (1.3.6)
  * sprockets (2.10.0)
  * sprockets-helpers (1.0.1)
  * sprockets-sass (1.0.1)
  * syntax (1.0.0)
  * thor (0.15.4)
  * tilt (1.3.7)
  * uglifier (1.2.7)
  * url_mount (0.2.1)

I have even manually installed the run gem, but it is probably not what I need:

gem install run

My ruby:

$ rbenv version
2.1.0 (set by /home/gonvaled/.rbenv/version)

Creating private password for FTP login

If I am hosting my site on a public repo but would like to have my ftp creds private, what is the best way to manage this? Put them in an external yaml file or just ignore the file with git?

Github pages settings

Hi, I was wondering if it was possible to ask for support for github pages without being restricted to the gh-pages branch. Personal pages need to be in the origin branch so I wondered if it was possible to add some form of option to specify which branch to deploy to (much like octopress does)?

Deployment erases source files.

I managed to deploy my website with middleman-deploy but it erased my repo and put the build files at https://github.com/raybesiga/raybesiga.github.com. As such, the website now works fine. However, I cannot make edits to the build.

Luckily, I have another repo cloned that can allow me to build from source. How can I make it such that I can make changes in my source repo https://github.com/raybesiga/raymmsite and build to https://github.com/raybesiga/raybesiga.github.com?

Any help will be appreciated.

Already initialized constant VERSION

Hi,

Whenever I start the server, build, or deploy, I get this warning message printed to the console:

/Library/Ruby/Gems/1.8/gems/middleman-deploy-0.1.0/lib/middleman-deploy/commands.rb:7: warning: already initialized constant VERSION

It doesn't seem to affect anything, and everything works as expected. Does everyone get this? Or is indicating something wrong with my setup?

Thanks,

Error when using middleman 4.0.0.rc.1

I've got my Gem pointing to master but still getting the following errors

/usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/configuration.rb:75:in `define_setting': Setting method doesn't exist (RuntimeError)
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/configuration.rb:37:in `[]='
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/configuration.rb:46:in `method_missing'
    from /Users/craigmdennis/Sites/test/config.rb:51:in `block in evaluate_configuration!'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/extension.rb:367:in `setup_options'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/extension.rb:294:in `initialize'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/middleman-deploy-243ab38b0889/lib/middleman-deploy/extension.rb:31:in `initialize'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/extension_manager.rb:64:in `new'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/extension_manager.rb:64:in `activate'
    from /Users/craigmdennis/Sites/test/config.rb:50:in `evaluate_configuration!'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/application.rb:290:in `instance_eval'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/application.rb:290:in `evaluate_configuration!'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/application.rb:266:in `start_lifecycle'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/application.rb:254:in `initialize'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/preview_server.rb:107:in `new'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/preview_server.rb:107:in `new_app'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-core-4.0.0.rc.1/lib/middleman-core/preview_server.rb:27:in `start'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-cli-4.0.0.rc.1/lib/middleman-cli/server.rb:67:in `server'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:40:in `block in register'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/var/rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/middleman-cli-4.0.0.rc.1/bin/middleman:23:in `<top (required)>'
    from /usr/local/var/rbenv/versions/2.2.0/bin/middleman:23:in `load'
    from /usr/local/var/rbenv/versions/2.2.0/bin/middleman:23:in `<main>'

Can't deploy! Please add a remote with the name 'production' to your repo

I ' ve followed the example configuration for deploy in multiple remotes and I have created a second remote which is correctly listed under git remote -v.
There are two issues:

  1. the Rakefile does not start middleman (it prints the proper param, then exits)
  2. trying to start the command manually like this
    TARGET=production bundle exec middleman deploy

I get the error
Can't deploy! Please add a remote with the name 'production' to your repo
even if it should exist.

I am doing something wrong ?

deploy.user param not working

Setting deploy.user to root ( yes thats bad ) but it fails anyway,
im unable to get it to use anything different then my OSX username.

How could this be resolved? I need a certain user to be able to deploy and the setting in config.rb is not picked up!

Good to mention Im using Git for deploy

My config is attached on https://gist.github.com/rubytastic/c8feedfe094fba9da4c0

Any thoughts why its not used on git deploy?

Generic rescues

I've been racking my brain trying to find what broke, but my deploy always triggers "You need to activate deploy...". I've had a working deploy config for the past several versions, and nothing but the version has changed.

My concern is the following line (and ones like it): https://github.com/tvaughan/middleman-deploy/blob/master/lib/middleman-deploy/commands.rb#L105

That is making it really difficult to debug the issue: generic "rescue all" clauses are a definite no-no for reasons like this.

Instead, what particular exception needs to be handled there? Otherwise, someone (like myself) will spend hours trying to figure out why their deploy is wrong, when it really could be something totally unrelated.

So if you know what exceptions should be raised and rescued, list them explicitly -- stack traces for other issues are a life saver =)

~ Jonathan

Build directory

Hi,

thanks for the great gem. One suggestion:
build path is hard coded and it should be inherit from middleman app options itself.

example:
now:

command = "rsync -avze '" + "ssh -p #{port}" + "' build/ #{user}@#{host}:#{path}"

should be

command = "rsync -avze '" + "ssh -p #{port}" + "'#{find me in app config}/ #{user}@#{host}:#{path}"

In my project i'm using "switching source" mechanism to support multiple sites in one project. It would be nice if build_dir fork here also...

Thanks

Can't deploy to an org level repo

Hi,

I'm trying to use middleman-deploy to deploy http://marionettejs.com - which is hosted on github, using an organizational pages repo at from https://github.com/marionettejs/marionettejs.github.com

Since the org repo uses the "master" branch to host the site, and not gh-pages, the standard set up for middleman-deploy fails.

I tried to work around this by setting up https://github.com/marionettejs/www-source as the repo that my middleman app is stored in. I then set up middle-man deploy with these settings:

activate :deploy do |deploy|
  deploy.method = :git
  deploy.remote = "live-site"
  deploy.branch = "master"
end

where the "live-site" remote points to [email protected]:marionettejs/marionettejs.github.com.

This configuration also fails. When I run middleman deploy I get the following output:

$ middleman deploy
## Deploying via git to remote="live-site" and branch="master"
/Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/git-1.2.5/lib/git/lib.rb:700:in `command': git checkout "-b" "master" "origin/master"  2>&1:fatal: A branch named 'master' already exists. (Git::GitExecuteError)
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/git-1.2.5/lib/git/lib.rb:492:in `checkout'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/git-1.2.5/lib/git/base.rb:287:in `checkout'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bundler/gems/middleman-deploy-b67854ae603c/lib/middleman-deploy/commands.rb:136:in `block in deploy_git'
    from /Users/derickbailey/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bundler/gems/middleman-deploy-b67854ae603c/lib/middleman-deploy/commands.rb:133:in `deploy_git'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bundler/gems/middleman-deploy-b67854ae603c/lib/middleman-deploy/commands.rb:33:in `deploy'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/middleman-core-3.0.6/lib/middleman-core/cli.rb:77:in `method_missing'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/task.rb:29:in `run'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/task.rb:126:in `run'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/middleman-core-3.0.6/lib/middleman-core/cli.rb:22:in `start'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/gems/middleman-core-3.0.6/bin/middleman:18:in `<top (required)>'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bin/middleman:19:in `load'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bin/middleman:19:in `<main>'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/derickbailey/.rvm/gems/ruby-1.9.3-p286@marionettejs/bin/ruby_noexec_wrapper:14:in `<main>'

It's failing when it tries to run git checkout -b master origin/master - which I don't understand... why would it try to checkout origin/master when i told it to use live-site/master? And why is it trying to check this branch out as a local master branch?

I'm likely doing something wrong here. This is my first time using middleman and middleman-deploy.

How would you fix this setup? What do you recommend I do, so that I can deploy my site to github and have it show up correctly?

Not deploying all build files

Hi there,

I am using the SFTP deploy option with the automatic build step before and it seems that not all of the build files for my project are deployed.

Any hints what might lead to this? I'm on a mac and everything else is working like a charm...

Regards, Chris

FTP deployments fail when FTP server needs TLS/SSL security settings.

Hi,

I'm trying to use middleman-deploy to push my builds directly to a client's FTP server.
Unfortunately their FTP server does not use basic FTP nor do they use SFTP… instead it uses FTP with TLS/SSL settings.

Trying to connect/deploy to it at the moment produces the following error:

/Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/ftp.rb:298:in `getresp': 421 Sorry, cleartext sessions are not accepted on this server. (Net::FTPTempError)
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/ftp.rb:325:in `block in sendcmd'
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/ftp.rb:323:in `sendcmd'
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/ftp.rb:430:in `block in login'
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/jannis/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/ftp.rb:429:in `login'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/middleman-deploy-0.0.11/lib/middleman-deploy/commands.rb:181:in `deploy_ftp'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/middleman-deploy-0.0.11/lib/middleman-deploy/commands.rb:31:in `deploy'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/middleman-core-3.0.13/lib/middleman-core/cli.rb:77:in `method_missing'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/task.rb:29:in `run'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/task.rb:126:in `run'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/middleman-core-3.0.13/lib/middleman-core/cli.rb:22:in `start'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/gems/middleman-core-3.0.13/bin/middleman:18:in `<top (required)>'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/bin/middleman:23:in `load'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/bin/middleman:23:in `<main>'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/jannis/.rvm/gems/ruby-1.9.3-p194@racv/bin/ruby_noexec_wrapper:14:in `<main>'

I noticed that @benben did the initial pull request for the deploy FTP component so perhaps one of you could take a look at this when you get a moment or simply let me know whether this FTP+TLS/SSL isn't and won't be supported :).

Rsync - support for non specified user

I currently have a site where three or four people can deploy.

When we were doing this manually the rsync URL was just

hostname.domain.tld:/path/to/site

Then - in each user's ~/.ssh/config we had

Host *domain.tld
    User username

This meant that we could keep the username out of the config - and it therefore worked for all of us.

Moving over to the deploy plugin the username seems to be required.

Could it be possible to make it optional so that it can be picked up from the user's own ssh config?

FTP: Upload only changed files

Would it be worth adding a setting to only upload files changed since the last upload, when using FTP? It seems inefficient to transfer the whole site every time.

I'm not suggesting that the remote timestamps be checked or anything; ideally for me it would be a setting where if deploy.build_before = true then files that are identical on build will be skipped.

Submodule strategy fails

I have a submodule build initialized at the root of my dir and I'm trying to deploy with this conf

activate :deploy do |deploy|
  deploy.method   = :git
  deploy.strategy = :submodule
  deploy.remote   = 'origin'
  deploy.branch   = 'master'
end

And the output is

## Deploying via git to remote="origin" and branch="master"
Already on 'master'
No stash found.
Can't deploy! Please resolve conflicts. Then process to manual commit and push on master branch.

If I look at the source, I see that stashes are involved. What exactly is stash used for? If I have previously updated everything and root and submodule repos are clean then there is nothing to stash and pop. Am I right or I'm getting something fundamentally wrong?

Small images not properly uploaded?

Hi,

Love this. However the ftp deploy doesn't seem to upload small images properly. It creates the file on the server but it is invalid/corrupt/not-enough-data. Rsync does fine but FTP does not?

I have little experience with ruby. Is the net/ftp code right for binary files?

Might be worth looking into. here is an example file that doesn't get uploaded properly: http://files.airfront.co.uk/directory/08_temp/background.png

Great work though. Very helpful.

== Unknown Extension: deploy

Hello, when i start the server, i got the follow message == Unknown Extension: deploy

$ middleman
== The Middleman is loading
== Unknown Extension: deploy
== The Middleman is standing watch on port 4567

config.rb

activate :deploy do |deploy|
  deploy.method = :rsync
  deploy.user = ''
  deploy.host = ''
  deploy.path = ''
  deploy.clean = true
end

Gemfile

source :rubygems

group :development do
  gem 'middleman', '3.0.2'
  gem 'middleman-deploy', '0.0.5'
  gem 'compass', '0.12.2'
  gem 'compass-normalize', '1.3'
  gem 'susy', '1.0'
end

Repository moved, MM deploy doesn't use new origin

When we move repositories around and update the local git remotes, a middleman deploy still insists on deploying to the old location. I've found that a local purge and clone from the new source fixes this, but I'm not sure where MM deploy is pulling those old remotes from. Any ideas?

FTP deploy copying .git directory??

When I deploy using FTP, I do not want to copy the .git directory (which is huge).

$ be middleman deploy
## Deploying via ftp to [email protected]:
Copied .git/COMMIT_EDITMSG
Copied .git/config
Copied .git/description
Copied .git/HEAD
Created directory .git/hooks
Copied .git/hooks/applypatch-msg.sample
Copied .git/hooks/commit-msg.sample
Copied .git/hooks/post-update.sample
Copied .git/hooks/pre-applypatch.sample

I am using the standard config settings as per readme. Anyone else experiencing this?

The usage of "ptools" seems to break the "build" function of middleman on Windows

My ruby skill is not good enough so I came here to look for help.

I'm now using middleman-deploy (0.2.3) with middleman (3.3.2) & ptools (1.2.4-x86-mingw32).

When trying to build the console throws:

E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:47:in `[]': no implicit conversion from nil to integer (TypeError)
        from E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:47:in `chop_basename'
        from E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:102:in `cleanpath_aggressive'
        from E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:90:in `cleanpath'
        from E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:486:in `relative_path_from'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/cli/build.rb:193:in `execute!'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/cli/build.rb:128:in `invoke!'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/cli/build.rb:70:in `build'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/cli.rb:76:in `method_missing'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/cli.rb:22:in `start'
        from E:/usr/local/Ruby/lib/ruby/gems/2.0.0/gems/middleman-core-3.3.2/bin/middleman:18:in `<top (required)>'
        from E:/usr/local/Ruby/bin/middleman:23:in `load'
        from E:/usr/local/Ruby/bin/middleman:23:in `<main>'

I traced to E:/usr/local/Ruby/lib/ruby/2.0.0/pathname.rb:43:

base = File.basename(path)

And at the final moment between crach, the result of File.basename became wired.

Before required ptools, File.basename 'E:/' returns "/" and everything was good.

After required ptools, File.basename 'E:/' returns "E:\\", then cause the cause the following codes crashed:

    if /\A#{SEPARATOR_PAT}?\z/o =~ base
      return nil
    else
      return path[0, path.rindex(base)], base
    end

I know nor whether this is a bug or a 'by design' for ptools, nor whether this is expected for middleman-deploy, nor whether there will be another solution to get it work. Is there anybody can help?

Thanks

Deploy error in Windows 8.1

I added the gem and added activate :deploy (+ configs) for FTP upload.

When I run middleman deploy (or with bundle exec), I get the following error. Not sure where to start with this one. Any help would be appreciated.

Windows 8.1 64-bits, Ruby 2.1.0.

c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core-3.3.10/lib/m
iddleman-more/core_extensions/default_helpers.rb:7:in <top (required)>': uninit ialized constant Padrino::Helpers::OutputHelpers (NameError) from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core -3.3.10/lib/middleman-core/core_extensions.rb:30:inrequire'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core
-3.3.10/lib/middleman-core/core_extensions.rb:30:in <top (required)>' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core -3.3.10/lib/middleman-core/application.rb:24:inrequire'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core
-3.3.10/lib/middleman-core/application.rb:24:in <top (required)>' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-depl oy-1.0.0/lib/middleman-deploy/commands.rb:62:indeploy_options'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-depl
oy-1.0.0/lib/middleman-deploy/commands.rb:36:in build_before' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-depl oy-1.0.0/lib/middleman-deploy/commands.rb:29:indeploy'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li
b/thor/command.rb:27:in run' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li b/thor/invocation.rb:126:ininvoke_command'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li
b/thor.rb:359:in dispatch' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li b/thor/base.rb:440:instart'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core
-3.3.10/lib/middleman-core/cli.rb:72:in method_missing' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li b/thor/command.rb:29:inrun'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li
b/thor/command.rb:126:in run' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li b/thor/invocation.rb:126:ininvoke_command'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li
b/thor.rb:359:in dispatch' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/li b/thor/base.rb:440:instart'
from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core
-3.3.10/lib/middleman-core/cli.rb:20:in start' from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/middleman-core -3.3.10/bin/middleman:18:in<top (required)>'
from c:/RailsInstaller/Ruby2.1.0/bin/middleman:23:in load' from c:/RailsInstaller/Ruby2.1.0/bin/middleman:23:in

'

Getting this error on deploy

I've followed to guide strictly and check with various ftp connections.

activate :deploy do |deploy|
  deploy.method = :ftp
  deploy.host = "ftp.servage.net"
  deploy.user = "trustpilot"
  deploy.password = "mypassword"
  deploy.path = "/www"
end

The error I get in my terminal


[~/Sit.../trustpilot/www] (www) $ middleman deploy
## Deploying via ftp to [email protected]:/
/Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-deploy-0.0.9/lib/middleman-deploy/commands.rb:179:in `chdir': No such file or directory - build/ (Errno::ENOENT)
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-deploy-0.0.9/lib/middleman-deploy/commands.rb:179:in `deploy_ftp'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-deploy-0.0.9/lib/middleman-deploy/commands.rb:31:in `deploy'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-core-3.0.9/lib/middleman-core/cli.rb:77:in `method_missing'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/task.rb:29:in `run'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/task.rb:126:in `run'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor.rb:275:in `dispatch'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-core-3.0.9/lib/middleman-core/cli.rb:22:in `start'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/gems/middleman-core-3.0.9/bin/middleman:18:in `<top (required)>'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/bin/middleman:19:in `load'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/bin/middleman:19:in `<main>'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/lajlev/.rvm/gems/ruby-1.9.3-p194@rails328/bin/ruby_noexec_wrapper:14:in `<main>'
´´´

Deploy discards changes

I'm confused by these lines in the git deploy method:

#if there is a remote branch with that name, reset to it, otherwise just create a new one
if `git branch -r`.split("\n").keep_if{ |r| r =~ Regexp.new(branch,true) }.count > 0
  `git reset --hard origin/#{branch}`
else
  `git checkout -b #{branch}`
end

I have the branch set to master as I'm publishing to a (username).github.com repository. I run middleman build, and that creates updated files in build/. I already have a git repository with the appropriate remotes set up, from a previous deploy, so middleman-deploy changes into the build directory, and executes git reset --hard origin/master. That discards all the changes. Then it pushes an empty commit.

Is there something I'm not understanding about how to configure the extension? My config.rb contains:

activate :deploy do |deploy|
  deploy.method = :git
  deploy.remote = "[email protected]:cpence/cpence.github.com.git"
  deploy.branch = "master"
end

Change commit message during deploy

I'm wondering if it would be possible to add a feature of changing the commit message during the deploy command. Maybe during deploy ask for message or just use default. I'm not sure if that's already available but I didn't see it. Nor do I know if it's a feasible request.

Feature request: ability to deploy to multiple environments

Thanks for this great Middleman extension !

One feature I would really like is to publish on differents environments with the CLI.
eg.:
"middleman deploy -e staging" would publish to /my-staging-ftp/www
"middleman deploy -e production" would publish to /my-prod-ftp/www

How could I do that ?

rsync produces error on MacOS

Using the rsync method on MacOS transfers files, but produces an error. It's likely the handling of the explicit port.

tbase: ~/foo.com $ rsync -rvzptO "ssh -p 22" "/Users/trooney/Dropbox/logic/foo.com/build/" "[email protected]:/var/www/stage.logic.bm/"
building file list ... rsync: link_stat "/Users/trooney/foo.com/ssh -p 22" failed: No such file or directory (2)
done

sent 3969 bytes  received 20 bytes  2659.33 bytes/sec
total size is 3325686  speedup is 833.71
rsync error: some files could not be transferred (code 23)

Rsync File Permissions

Would it be possible to add a option to specify the file permissions when deploying via rsync? It looks like it can be done with the -chmod tag, for example

--chmod=a+rwx,g+rwx,o-wx

which gives a value of 774.

*apologies if I am doing this wrong, this is my first issue on github...

"deploy.after_build" - stops/cancels out "after_build do"

I was doing a HTMLBeautification after build with "after_build do" like so:

configure :build do
    after_build do
        system('htmlbeautifier build/*/*.html')
    end
end

but that never runs/fires if I have: deploy.after_build = true set for middleman-deploy. Sorry to throw a spanner in the works. I just thought I'd raise it as it might crop up for a few people.

cc: @tdreyno

Support for Middleman v4?

"Remove old module-style extension support" is on the list of the v4 upgrade path, which I believe has caused the following error when trying to rebuild a simple Middleman app:

$ middleman build
.../gems/middleman-core-4.0.0.beta.2/lib/middleman-core/extensions.rb:96:in `load':
Tried to activate old-style extension: deploy. They are no longer supported. (RuntimeError)
# config.rb
activate :deploy do |deploy|
  deploy.method = :git
end

Could anyone shed any light if there are any plans for v4 compatibility for middleman-deploy?

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.