|
| 1 | +# grunt-deploy (Still in development, not ready to use) |
| 2 | + |
| 3 | +> The Grunt plugin to deploy nodejs app into ubuntu |
| 4 | + |
| 5 | +## Getting Started |
| 6 | +This plugin requires Grunt `~0.4.1` |
| 7 | + |
| 8 | +If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: |
| 9 | + |
| 10 | +```shell |
| 11 | +npm install grunt-deploy --save-dev |
| 12 | +``` |
| 13 | + |
| 14 | +Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: |
| 15 | + |
| 16 | +```js |
| 17 | +grunt.loadNpmTasks('grunt-deploy'); |
| 18 | +``` |
| 19 | + |
| 20 | +## The "deploy" task |
| 21 | + |
| 22 | +### Overview |
| 23 | +In your project's Gruntfile, add a section named `deploy` to the data object passed into `grunt.initConfig()`. |
| 24 | + |
| 25 | +```js |
| 26 | +grunt.initConfig({ |
| 27 | + deploy: { |
| 28 | + options: { |
| 29 | + // Task-specific options go here. |
| 30 | + }, |
| 31 | + your_target: { |
| 32 | + // Target-specific file lists and/or options go here. |
| 33 | + }, |
| 34 | + }, |
| 35 | +}) |
| 36 | +``` |
| 37 | + |
| 38 | +### Options |
| 39 | + |
| 40 | +#### options.separator |
| 41 | +Type: `String` |
| 42 | +Default value: `', '` |
| 43 | + |
| 44 | +A string value that is used to do something with whatever. |
| 45 | + |
| 46 | +#### options.punctuation |
| 47 | +Type: `String` |
| 48 | +Default value: `'.'` |
| 49 | + |
| 50 | +A string value that is used to do something else with whatever else. |
| 51 | + |
| 52 | +### Usage Examples |
| 53 | + |
| 54 | +#### Default Options |
| 55 | +In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.` |
| 56 | + |
| 57 | +```js |
| 58 | +grunt.initConfig({ |
| 59 | + deploy: { |
| 60 | + options: {}, |
| 61 | + files: { |
| 62 | + 'dest/default_options': ['src/testing', 'src/123'], |
| 63 | + }, |
| 64 | + }, |
| 65 | +}) |
| 66 | +``` |
| 67 | + |
| 68 | +#### Custom Options |
| 69 | +In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!` |
| 70 | + |
| 71 | +```js |
| 72 | +grunt.initConfig({ |
| 73 | + deploy: { |
| 74 | + options: { |
| 75 | + separator: ': ', |
| 76 | + punctuation: ' !!!', |
| 77 | + }, |
| 78 | + files: { |
| 79 | + 'dest/default_options': ['src/testing', 'src/123'], |
| 80 | + }, |
| 81 | + }, |
| 82 | +}) |
| 83 | +``` |
| 84 | + |
| 85 | +## Contributing |
| 86 | +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](http://gruntjs.com/). |
| 87 | + |
| 88 | +## Release History |
| 89 | +_(Nothing yet)_ |
0 commit comments