|
1 |
| -# ember-cli-deploy-manifest-json |
| 1 | +# ember-cli-deploy-index-json |
2 | 2 |
|
3 |
| -> An Ember CLI Deploy plugin to ....... (you could add a tag line for your plugin here) |
| 3 | +> An Ember CLI Deploy plugin to use a JSON index rather than an HTML one as provided by [`ember-cli-deploy-s3-index`](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index). |
4 | 4 |
|
5 |
| -[TODO] You could write a short summary of your plugin here |
| 5 | +This JSON index file is meant to be consumed by some application embedding yours. |
| 6 | + |
| 7 | +``` |
| 8 | +$ ember deploy production |
| 9 | +$ cat tmp/deploy-dist/index.json |
| 10 | +{ |
| 11 | + "assets/dummy.css": "assets/dummy-d41d8cd98f00b204e9800998ecf8427e.css", |
| 12 | + "assets/dummy.js": "assets/dummy-f1caa4785f44f7dc0ca9118458c120f8.js", |
| 13 | + "assets/vendor.js": "assets/vendor-b3a3b580d0c1bf83382792291e35020b.js", |
| 14 | + "assets/vendor.css": "assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css", |
| 15 | + "crossdomain.xml": "crossdomain.xml", |
| 16 | + "robots.txt": "robots.txt" |
| 17 | +} |
| 18 | +``` |
6 | 19 |
|
7 | 20 | ## What is an Ember CLI Deploy plugin?
|
8 | 21 |
|
9 | 22 | A plugin is an addon that can be executed as a part of the Ember CLI Deploy pipeline. A plugin will implement one or more of the Ember CLI Deploy's pipeline hooks.
|
10 | 23 |
|
11 | 24 | For more information on what plugins are and how they work, please refer to the [Plugin Documentation][1].
|
12 | 25 |
|
13 |
| -## Quick Start |
| 26 | +## Setup |
| 27 | + |
| 28 | +- Requirements |
| 29 | + |
| 30 | +You'll first have to [setup `ember-cli-deploy-s3-index`](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index#quick-start). |
14 | 31 |
|
15 | 32 | - Install this plugin
|
16 | 33 |
|
17 | 34 | ```bash
|
18 |
| -$ ember install ember-cli-deploy-manifest-json |
| 35 | +$ ember install ember-cli-deploy-index-json |
19 | 36 | ```
|
20 | 37 |
|
21 |
| -[TODO] You could add some sensible default config examples needed to quickly run your plugin |
| 38 | +- Configuration |
22 | 39 |
|
23 |
| -- Run the pipeline |
| 40 | +Edit `config/deploy.js` so that your configuration looks like the snippet below. |
24 | 41 |
|
25 |
| -```bash |
26 |
| -$ ember deploy |
| 42 | +```js |
| 43 | +s3: {}, |
| 44 | +'revision-data': { |
| 45 | + filePattern: 'index.json', |
| 46 | + type: 'version-commit' |
| 47 | +}, |
| 48 | +'s3-index': { |
| 49 | + filePattern: 'index.json' |
| 50 | +} |
27 | 51 | ```
|
28 | 52 |
|
29 |
| -## Installation |
30 |
| -Run the following command in your terminal: |
| 53 | +*In depth:* The idea is that `revision-data`, `s3-index` and `index-json` have the same `filePattern` value. `index-json` is not present in this example because we're using its default `filePattern` value. |
31 | 54 |
|
32 |
| -```bash |
33 |
| -ember install ember-cli-deploy-manifest-json |
34 |
| -``` |
| 55 | +## Usage |
| 56 | + |
| 57 | +- Deploy version to production environment |
| 58 | + |
| 59 | +`ember deploy production` |
| 60 | + |
| 61 | +- List versions on production environment |
| 62 | + |
| 63 | +`ember deploy:list production` |
| 64 | + |
| 65 | +- Activate a version on the production environment |
| 66 | + |
| 67 | +`ember deploy:activate --revision <revision-key>` |
35 | 68 |
|
36 | 69 | ## Ember CLI Deploy Hooks Implemented
|
37 | 70 |
|
38 | 71 | For detailed information on what plugin hooks are and how they work, please refer to the [Plugin Documentation][1].
|
39 | 72 |
|
40 |
| -[TODO] You should add a list of the pipeline hooks that your plugin implements here, for example: |
41 |
| - |
42 |
| -- `configure` |
43 |
| -- `build` |
44 |
| -- `upload` |
| 73 | +- `willUpload` |
45 | 74 |
|
46 | 75 | ## Configuration Options
|
47 | 76 |
|
48 | 77 | For detailed information on how configuration of plugins works, please refer to the [Plugin Documentation][1].
|
49 | 78 |
|
50 |
| -[TODO] You should describe the config options your plugin accepts here, for example: |
| 79 | +### filePattern |
51 | 80 |
|
52 |
| -### someConfigProperty |
| 81 | +Files matching this pattern will be included in the index. |
53 | 82 |
|
54 |
| -[TODO] Some description of this config property should go here |
| 83 | +*Default:* `'**/*.{js,css,png,gif,ico,jpg,map,xml,txt,svg,swf,eot,ttf,woff,woff2}'` |
55 | 84 |
|
56 |
| -*Default:* `'some sensible default could go here'` |
| 85 | +### fileIgnorePattern |
57 | 86 |
|
58 |
| -## Prerequisites |
| 87 | +Files matching this pattern will *not* be included in the index even if they match filePattern. |
| 88 | + |
| 89 | +*Default:* `null` |
| 90 | + |
| 91 | +### indexPath |
| 92 | + |
| 93 | +The JSON index file name. If changed, you should adapt `revision-data` and `s3-index` plugins configs accordingly. |
| 94 | + |
| 95 | +*Default:* `'index.json'` |
59 | 96 |
|
60 |
| -The following properties are expected to be present on the deployment context object: |
| 97 | +### distDir |
61 | 98 |
|
62 |
| -[TODO] You should describe which context properties your plugin depends on, for example: |
| 99 | +Directory where assets have been written to |
| 100 | + |
| 101 | +*Default:* the `distDir` property of the deployment context |
| 102 | + |
| 103 | +### distFiles |
| 104 | + |
| 105 | +The Array of built assets. |
| 106 | + |
| 107 | +*Default:* the `distFiles` property of the deployment context |
| 108 | + |
| 109 | +## Prerequisites |
63 | 110 |
|
64 |
| -- `distDir` (provided by [ember-cli-deploy-build][2]) |
| 111 | +No properties are expected to be present on the deployment context object. |
65 | 112 |
|
66 | 113 | ## Tests
|
67 | 114 |
|
|
0 commit comments