forked from webrain/grunt-wordpress-deploy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
57 lines (57 loc) · 10.2 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"name": "grunt-wordpress-deploy",
"description": "Deploy Wordpress without pain using Grunt.",
"version": "1.1.1",
"homepage": "https://github.com/madebycaliper/grunt-wordpress-deploy",
"author": {
"name": "Eli Silverman",
"email": "[email protected]",
"url": "http://www.madebycaliper.com"
},
"repository": {
"type": "git",
"url": "[email protected]:jambox/grunt-wordpress-deploy.git"
},
"bugs": {
"url": "https://github.com/madebycaliper/grunt-wordpress-deploy/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/madebycaliper/grunt-wordpress-deploy/blob/master/LICENSE-MIT"
}
],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {
"shelljs": "~0.1.4",
"line-reader": "~0.2.3",
"replace": "^0.3.0"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-nodeunit": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-shell": "~0.6.0"
},
"peerDependencies": {
"grunt": ">=0.4.0"
},
"keywords": [
"gruntplugin",
"deploy",
"wordpress"
],
"readme": "# Grunt Wordpress Deployments\n\nDeploy a Wordpress instance without pain using Grunt.\n\nThis plugin leverages on Grunt to push and pull a Wordpress instance into the predefined locations.\nHere's a tour of the features:\n\n* Multiple environments support: you can define different environments such as `development`, `staging`, `production` and so on, with different access credentials, paths and domains.\n* Adapt the Wordpress database to the destination domain: It replaces all the instances of the source environment domain with the destination environment domain, even into serialized data.\n* Push and pull files with rsync.\n* Completely based on Javascript, leverages only on some common system tools to perform the tasks (`mysql`, `mysqldump`, `ssh`).\n\n## Requirements\n\nThis plugin requires:\n\n* Grunt `~0.4.1`\n* `ssh`\n* `rsync`\n* `mysqldump`\n\nTo be able to use this plugin it's important to have access to the remote machine through `ssh`, with ssh key authentication to avoid password entering during the tasks. As this is a different topic we will not cover it here but you might like to start by reading [Github's own advice](https://help.github.com/articles/generating-ssh-keys).\n\n## Getting started\n\nThis is a [Grunt](http://gruntjs.com/) plugin, so it requires Grunt. It's really easy to install, as explained into the [Getting Started](http://gruntjs.com/getting-started) guide. Please read the guide to understand how does this works.\n\nWhen Grunt is installed on your machine, you can install this plugin with the following command:\n\n```shell\nnpm install grunt-wordpress-deploy --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled and configured into your Gruntfile.js. Please follow the example Gruntfile to configure your environments.\n\n```js\nmodule.exports = function(grunt) {\n \"use strict\";\n\n grunt.initConfig({\n wordpressdeploy: {\n options: {\n backup_dir: \"backups/\",\n rsync_args: ['--verbose', '--progress', '-rlpt', '--compress', '--omit-dir-times', '--delete'],\n exclusions: ['Gruntfile.js', '.git/', 'tmp/*', 'backups/', 'wp-config.php', 'composer.json', 'composer.lock', 'README.md', '.gitignore', 'package.json', 'node_modules']\n },\n local: {\n \"title\": \"local\",\n \"database\": \"database_name\",\n \"user\": \"database_username\",\n \"pass\": \"database_password\",\n \"host\": \"database_host\",\n \"url\": \"http://local_url\",\n \"path\": \"/local_path\"\n },\n staging: {\n \"title\": \"staging\",\n \"database\": \"database_name\",\n \"user\": \"database_username\",\n \"pass\": \"database_password\",\n \"host\": \"database_host\",\n \"url\": \"http://staging_url\",\n \"path\": \"/staging_path\",\n \"ssh_host\": \"user@staging_host\"\n },\n your_environment: {\n ...\n }\n },\n });\n\n // Load tasks\n grunt.loadNpmTasks('grunt-wordpress-deploy');\n\n // Register tasks\n grunt.registerTask('default', [\n 'wordpressdeploy'\n ]);\n};\n```\n\nIn the example above we define two environments, one is mandatory and is always called `local`, another is optional and can be called the way you want. In this case we have defined a second environment called `staging`.\n\n## Available tasks\n\nThe plugin defines a serie of tasks. Here's a brief overview:\n\n* `grunt push_db --target=environment_name`: Push the local database to the specified environment.\n* `grunt pull_db --target=environment_name`: Pull the database on the specified environment into the local environment.\n* `grunt push_files --target=environment_name`: Push the local files to the specified environment, using rsync.\n* `grunt pull_files --target=environment_name`: Pull the files from the specified environment to the local environment, using rsync.\n\n### Push_db\n\nExample execution: `grunt push_db --target=staging`\n\nThe `push_db` command moves your local database to a remote database location, specified by the target environment. What happens under the hood is the following:\n\n- Dump the local database\n- Adapt the local dump to the remote environment executing a search and replace to change the instances of the local domain with the instances of the remote domain, taking care of serialized data\n- Backups the database on the target environment\n- Imports the local adapted dump into the remote database\n\n\n### Pull_db\n\nExample execution: `grunt pull_db --target=staging`\n\nThe `pull_db` command moves your target environment database to the local database. What happens under the hood is the following:\n\n- Dump the remote database\n- Adapt the remote dump to the local environment executing a search and replace to change the instances of the remote domain with the instances of the local domain, taking care of serialized data\n- Backups the database on the local environment\n- Imports the remote adapted dump into the local database\n\n### Push_files\n\nExample execution: `grunt push_files --target=staging`\n\nThe `push_files` command moves your local environment files to the target environment using rsync.\n\nThis operation is not reversible.\n\nInto `Gruntfile.js` is possible to set which options rsync will use, and which files should be exluded from the synchronization.\nMore details in the configuration section below.\n\n```js\n grunt.initConfig({\n wordpressdeploy: {\n options: {\n backup_dir: \"backups/\",\n rsync_args: ['--verbose', '--progress', '-rlpt', '--compress', '--omit-dir-times', '--delete'],\n exclusions: ['Gruntfile.js', '.git/', 'tmp/*', 'backups/', 'wp-config.php', 'composer.json', 'composer.lock', 'README.md', '.gitignore', 'package.json', 'node_modules']\n },\n local: {\n ...\n```\n\n### Pull_files\n\nExample execution: `grunt pull_files --target=staging`\n\nThe `pull_files` command moves your target environment files to the local environment using rsync.\n\nThis operation is not reversible.\n\nInto `Gruntfile.js` is possible to set which options rsync will use, and which files should be exluded from the synchronization.\n\n\n### Configuration\n\nEach target expects a series of configuration options to be provided to enable the task to function correctly. These are detailed below:\n\n#### title\nType: `String`\n\nDescription: A proper case name for the target. Used to describe the target to humans in console output whilst the task is running.\n\n#### database\nType: `String`\n\nDescription: the name of the database for this target.\n\n#### user\nType: `String`\n\nDescription: the database user with permissions to access and modify the database\n\n#### pass\nType: `String`\n\nDescription: the password for the database user (above)\n\n#### host\nType: `String`\n\nDescription: the hostname for the location in which the database resides.\n\n#### url\nType: `String`\n\nDescription: the string to search and replace within the database before it is moved to the target location. This is designed for use with the awful Wordpress implementation which stores [the site url into the database](http://codex.wordpress.org/Changing_The_Site_URL) and is required to be updated upon migration to a new environment.\n\n#### path\nType: `String`\n\nDescription: the path of the the installation files on the filesystem. Used by rsync to update the correct folder on synchronization.\n\n#### ssh_host\nType: `String`\n\nDescription: ssh connection string in the format `SSH_USER@SSH_HOST`. The task assumes you have ssh keys setup which allow you to remote into your server without requiring the input of a password.\n\n### Options\n\n#### options.backups_dir\nType: `String`\n\nDefault value: `backups`\n\nA string value that represents the directory path (*relative* to your Grunt file) to which you want your database backups for source and target to be saved prior to modifications.\n\nYou may wish to have your backups reside outside the current working directory of your Gruntfile. In which case simply provide the relative path eg: ````../../backups````.\n\n#### options.rsync_args\nType: `Array`\n\nDefault value: `['--verbose', '--progress', '-rlpt', '--compress', '--omit-dir-times', '--delete']`\n\nAn array representing all parameters passed to the rsync command in order to perform the synchronization operation. The defult value in this example is fine for common usages of this plugin.\n\n\n#### options.exclusions\nType: `Array`\n\nDefault value: `['Gruntfile.js', '.git/', 'tmp/*', 'backups/', 'wp-config.php', 'composer.json', 'composer.lock', 'README.md', '.gitignore', 'package.json', 'node_modules']`\n\nAn array representing all excluded files and directories from the synchronization process.\n\n## History\n\nThis plugin is an almost complete rewrite of the [Grunt-Deployments Plugin](https://github.com/getdave/grunt-deployments).\nCredits to the original developer for the work on the original plugin.\n",
"readmeFilename": "README.md",
"_id": "[email protected]",
"_from": "grunt-wordpress-deploy@"
}