Deploys a git Repo to the WordPress SVN repo
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-wp-deploy --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-wp-deploy');
This task is for deploying a plug-in to the WordPress repository from a 'build directory'.
- To have been accepted on to the WordPress repository
- plugin-slug - You can get this from your plug-in's repo url: http://wordpress.org/plugins/{plugin-slug}
- readme.txt - See http://wordpress.org/plugins/about/#readme
- plugin-slug.php - The 'main file' of the plug-in (containing the plugin header). Currently this must be named {plugin-slug}.php where {plugin-slug} should be replaced by your plug-in's slug. See (2).
- build directory - This a complete copy of the plug-in as you want it on the directory
In your project's Gruntfile, add a section named wp_deploy
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
wp_deploy: {
deploy: {
options: {
plugin_slug: 'your-plugin-slug',
svn_user: 'your-wp-repo-username',
build_dir: 'build' //relative path to your build directory
},
}
},
})
Type: String
Default value: false
Your plug-in's slug as indicated by its repository url http://wordpress.org/plugins/{plugin-slug}
Type: String
Default value: false
Your WordPress repository username. If not provided, you'll be prompted for this when the task runs.
Type: String
Default value: false
The directory where the plug-in exists as you want it on the repo.
Type: String
Default value: http://plugins.svn.wordpress.org/{plugin-slug}
For flexibilty this plug-in can work with other repos. Simple provide the SVN url, using {plugin-slug}
as placeholder indicating where the plug-in slug should be.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- Add more verbose error messages.
- Use
cp -a
instead ofcp -ar
(fixes #1,#2)
- Improved regex for version detection in
{plugin-slug}.php
- Improved regex for version detection in
readme.txt
/{plugin-slug}.php
- Abort (fail with warning) if versions do not match
- Linted plug-in
- Corrected abort message
- Fixed readme
Initial release