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

exclusions and subfolders #64

Open
ivoba opened this issue Nov 4, 2014 · 1 comment
Open

exclusions and subfolders #64

ivoba opened this issue Nov 4, 2014 · 1 comment

Comments

@ivoba
Copy link

ivoba commented Nov 4, 2014

Not sure of its wrongly described in the readme, but i couldnt get subfolders like dist/tmp get excluded unless i changed it to ./dist/tmp.

In the grunt-ftp-deploy project there was a PR for changing relative pathes to prefxied pathes in the docs:
https://github.com/zonak/grunt-ftp-deploy/pull/54/files

This possibly applies to here as well.

@rizkysyazuli
Copy link

rizkysyazuli commented Apr 9, 2017

seriously? no response since 2014?

anyway, just in case anyone's still looking (like me), and i have to figure this out myself. it's best to use full paths (/path/to/folder) instead of relative paths (path/to/folder) when handling subfolders. just like how i configured it below.

keep the full path of your project somewhere in a config file. or your exclusion list will get really long.

"base_dir": "/Users/username/Sites/projectname"

load the config file inside grunt.initConfig.

conf: grunt.file.readJSON('config.json')

then append the <%= conf.base_dir %> var above to the list:

'sftp-deploy': {
    build: {
        auth: {
            host: '<%= conf.remote_host %>',
            port: 22,
            authKey: '<%= conf.env %>'
        },
        src: '<%= conf.base_dir %>',
        dest: '<%= conf.remote_dir %>',
        exclusions: [
            '<%= conf.base_dir %>/**/.DS_Store',
            '<%= conf.base_dir %>/application/cache',
            '<%= conf.base_dir %>/node_modules',
            '<%= conf.base_dir %>/public/assets/js/src',
            '<%= conf.base_dir %>/public/assets/scss',
            '<%= conf.base_dir %>/public/prototype',
            '<%= conf.base_dir %>/.sass-cache',
            '<%= conf.base_dir %>/.bowerrc',
            '<%= conf.base_dir %>/.editorconfig',
            '<%= conf.base_dir %>/.eslintrc',
            '<%= conf.base_dir %>/.ftppass*',
            '<%= conf.base_dir %>/.git',
            '<%= conf.base_dir %>/.gitattributes',
            '<%= conf.base_dir %>/.gitignore',
            '<%= conf.base_dir %>/.htmlhintrc',
            '<%= conf.base_dir %>/.sass-lint.yml',
            '<%= conf.base_dir %>/bower.json',
            '<%= conf.base_dir %>/config.json*',
            '<%= conf.base_dir %>/Gemfile*',
            '<%= conf.base_dir %>/Gruntfile.js',
            '<%= conf.base_dir %>/package.json'
        ],
        concurrency: 4,
        progress: true
    }
}

additional tips, If you want to ignore just the contents of a folder, but keep the folder intact on the remote server. use the star (*):

/path/to/folder/*

if you want to completely exclude it. do it like this:

/path/to/folder

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

2 participants