Grunt plug-in to deploy the WordPress plug-in to SVN repository.
- This plugin requires Grunt
~0.4.5 - Subversion installed and in your PATH.
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-plugin --save-devOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks( 'grunt-wp-plugin' );This task is for deploying a plug-in to the WordPress repository from a deploy directory.
Run this task with the grunt wp_plugin command.
- To have been accepted on to the WordPress repository
- readme.txt - See http://wordpress.org/plugins/about/#readme
- plugin-slug - Get this from your plug-in's repo url: http://wordpress.org/plugins/{plugin-slug}
- plugin-slug.php - The 'main file' of the plug-in(containing the plugin header). Currently this must be named
{plugin-slug}.phpwhere{plugin-slug}should be replaced by your plug-in's slug. See (3). - deploy directory - This is a complete copy of the plug-in as you want it on the directory.
- assets directory - (Optional) This directory should contain the plug-in's icons, banners and screenshots that you want in the 'assets' directory in the root of the plug-ins WordPress SVN repo. See https://wordpress.org/plugins/about/faq/ for details.
In your project's Gruntfile, add a section named wp_plugin to the data object passed into grunt.initConfig().
grunt.initConfig({
wp_plugin: {
deploy: {
options: {
assets_dir: 'wp-assets-dir', // Relative path to your assets directory (optional).
deploy_dir: 'wp-deploy-dir', // Relative path to your deploy directory (required).
plugin_slug: 'your-plugin-slug',
svn_username: 'your-wp-repo-username'
}
}
}
});Type: String
Default value: false
The directory where the plug-in's assets (i.e. icons, banners and screenshots) exist. This gets copied into the assets directory in the root of your WordPress SVN repo. Typically this directory contains your plug-in's icons, banners and screenshots, which you want uploaded to the WordPress repo, but do not necessary want included in the plug-in distributed to users. For more details see: https://wordpress.org/plugins/about/faq/.
Type: String
Default value: false
The directory where the plug-in exists as you want it on the repo.
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: 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.
Copyright (c) 2015 AxisThemes
Licensed under the MIT license:
http://axisthemes.mit-license.org/