Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not ignoring excluded files? #15

Open
j6s opened this issue Feb 11, 2015 · 0 comments
Open

Not ignoring excluded files? #15

j6s opened this issue Feb 11, 2015 · 0 comments

Comments

@j6s
Copy link

j6s commented Feb 11, 2015

I am having a weird issue with mina-rsync:

As a part of my deployment I precompile some stuff via one of my gulp tasks. For that I need to install my node_modules.

Of course - I don't want the node_modules folder to be rsynced, so I added it as --excluded in :rsync_options. The problem is; The setting seems to be discarded. Any idea why that is?

mina deploy -v shows me the following (correct) rsync command, which seems to not be used, because it is correct and works as it should, when I run it on the command line:

rsync --exclude ".git*" --exclude "node_modules/" --exclude "settings.json" --exclude "typings" --recursive --delete --delete-excluded tmp/deploy/ [email protected]:~/path/to/project

Here are the important parts of my deploy.rb:

require 'rubygems'
require 'bundler/setup'
require 'mina/rsync'

# ...
set :repository, '.'
set :branch, 'master'
set :rsync_options, %w[
    --exclude ".git*" 
    --exclude "node_modules/" 
    --exclude "settings.json"  
    --exclude "typings"  
    --recursive  
    --delete  
    --delete-excluded
]

# ...

# precompile task
task :precompile do
  Dir.chdir settings.rsync_stage do

    puts "-----> removing old builds"
    system "rm", "-R", "js", "htdocs/dist"

    puts "-----> Installing modules"
    # npm install is here
    system "npm", "install", "--quiet";
    system "bundle", "install";

    puts "-----> installing typescript definitions"
    system "tsd", "reinstall";

    puts "-----> running gulp build"
    system "gulp", "build";

    def checkfile(file)
      if not File.exists?(file)
        throw "file " + file + " does not exist"
      else
        puts "Compiled file exists: " + file;
      end
    end;

    puts "-----> checking if compiled files exist"
    checkfile("htdocs/dist/main.css")
    checkfile("htdocs/dist/scripts.js")
    checkfile("htdocs/dist/scripts.min.js")
  end;
end;

task "rsync:stage" do
  invoke :precompile;
end;

desc "Deploys the current version to the server."
task :deploy => :environment do
  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke "rsync:deploy"
    invoke "deploy:cleanup"
    queue "npm install --production --quiet"
    queue "cd htdocs && bower install"


    to :launch do
      queue "forever stopall"
      queue "forever start #{deploy_to}/#{current_path}/js/index.js"
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant