deploy script

This commit is contained in:
Mike Jolley 2014-02-10 12:52:41 +00:00
parent 9ae5cc5d8f
commit e2ceff5dfc
3 changed files with 45 additions and 2 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ Thumbs.db
.project
.settings*
sftp-config.json
/_deploy/
# Ignore all log files except for .htaccess
/logs/*

View File

@ -127,7 +127,37 @@ module.exports = function( grunt ){
'sed -i "" "s/\\/\\/exit( \'Locked\' );/exit( \'Locked\' );/g" index.php',
].join( '&&' )
}
}
},
copy: {
deploy: {
src: [
'**',
'.htaccess',
'!Gruntfile.js',
'!sftp-config.json',
'!package.json',
'!node_modules/**'
],
dest: '_deploy',
expand: true
},
},
clean: {
deploy: {
src: [ '_deploy' ]
},
},
wp_deploy: {
deploy: {
options: {
plugin_slug: 'woocommerce',
build_dir: '_deploy'
},
}
}
});
@ -137,6 +167,9 @@ module.exports = function( grunt ){
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-wp-deploy' );
// Register tasks
grunt.registerTask( 'default', [
@ -156,4 +189,10 @@ module.exports = function( grunt ){
'shell:generatemos'
]);
grunt.registerTask( 'deploy', [
'clean:deploy',
'copy:deploy',
'wp_deploy'
]);
};

View File

@ -10,7 +10,10 @@
"grunt-contrib-less": "~0.9.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-shell": "~0.6.4",
"grunt-contrib-watch": "~0.5.3"
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-clean": "0.5.x",
"grunt-wp-deploy": "0.3.x"
},
"engines": {
"node": ">=0.8.0",