webrain / grunt-wordpress-deploy

A Grunt plugin to quickly deploy Wordpress websites.
MIT License
104 stars 37 forks source link

added dump support #33

Open stefnw opened 9 years ago

stefnw commented 9 years ago

Hi, often you dont have ssh permissions to the live server. if you want to use the grunt-wordpress-deploy functions (especially the url-rewriting) its necessary to build a local instance of your wordpress installation. So i added the functionality to dump the local instance to another local folder with the given url-rewriting function.

Usage:

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    wordpressdeploy: {
        options: {
            backup_dir: "backups/",
            rsync_args: ['--verbose', '--progress', '-rlpt', '--compress', '--omit-dir-times'],
            exclusions: ['Gruntfile.js', '.git/', 'tmp/*']
        },
        local: {
            "title": "local",
            "database": grunt.option('database'),
            "user": grunt.option('user'),
            "pass": grunt.option('pass'),
            "host": grunt.option('host'),
            "url": grunt.option('local_url'),
            "path": grunt.option('local_path')
        },
        dump: {
            "title": "dump",
            "url": grunt.option('livecopy_url'),
            "path": grunt.option('livecopy_path'),
        }
    }
});
stefnw commented 9 years ago

The SQL Dump is saved within the folder of the dumped wordpress instance and is named "db_dump.sql"