Skip to content

Commit fb40d16

Browse files
committed
Update README for v0.5.0
1 parent 1a063a1 commit fb40d16

File tree

1 file changed

+136
-13
lines changed

1 file changed

+136
-13
lines changed

README.md

Lines changed: 136 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,148 @@
11
# Ember-cli-deploy-redis
22

3-
This README outlines the details of collaborating on this Ember addon.
3+
> An ember-cli-deploy-plugin to upload index.html to a Redis store
4+
5+
<hr/>
6+
**WARNING: This plugin is only compatible with ember-cli-deploy versions >= 0.5.0**
7+
<hr/>
8+
9+
This plugin uploads a file, presumably index.html, to a specified Redis store.
10+
11+
More often than not this plugin will be used in conjunction with the [lightning method of deployment][1] where the ember application assets will be served from S3 and the index.html file will be served from Redis. However, it can be used to upload any file to a Redis store.
12+
13+
## What is an ember-cli-deploy plugin?
14+
15+
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.
16+
17+
For more information on what plugins are and how they work, please refer to the [Plugin Documentation][2].
18+
19+
## Quick Start
20+
To get up and running quickly, do the following:
21+
22+
- Ensure [ember-cli-deploy-build][4] is installed and configured.
23+
24+
- Install this plugin
25+
26+
```bash
27+
$ ember install ember-cli-deploy-redis
28+
```
29+
30+
- Place the following configuration into `config/deploy.js`
31+
32+
```javascript
33+
ENV.redis {
34+
host: '<your-redis-host>',
35+
port: <your-redis-port>,
36+
password: '<your-redis-password>'
37+
}
38+
```
39+
40+
- Run the pipeline
41+
42+
```bash
43+
$ ember deploy
44+
```
445

546
## Installation
47+
Run the following command in your terminal:
648

7-
* `git clone` this repository
8-
* `npm install`
9-
* `bower install`
49+
```bash
50+
ember install ember-cli-deploy-redis
51+
```
1052

11-
## Running
53+
## ember-cli-deploy Hooks Implemented
54+
- `configure`
55+
- `upload`
56+
- `activate`
57+
- `didDeploy`
1258

13-
* `ember server`
14-
* Visit your app at http://localhost:4200.
59+
## Configuration Options
1560

16-
## Running Tests
61+
### host
62+
63+
The Redis host. If [url](#url) is defined, then this option is not needed.
64+
65+
*Default:* `'localhost'`
66+
67+
### port
68+
69+
The Redis port. If [url](#url) is defined, then this option is not needed.
70+
71+
*Default:* `6379`
72+
73+
### password
74+
75+
The Redis password. If [url](#url) is defined, then this option is not needed.
76+
77+
*Default:* `null`
78+
79+
### url
1780

18-
* `ember test`
19-
* `ember test --server`
81+
A Redis connection url to the Redis store
2082

21-
## Building
83+
*Example:* 'redis://some-user:some-password@some-host.com:1234'
84+
85+
### filePattern
86+
87+
A file matching this pattern will be uploaded to Redis.
88+
89+
*Default:* `'index.html'`
90+
91+
### distDir
92+
93+
The root directory where the file matching `filePattern` will be searched for. By default, this option will use the `distDir` property of the deployment context.
94+
95+
*Default:* `context.distDir`
96+
97+
### keyPrefix
98+
99+
The prefix to be used for the Redis key under which file will be uploaded to Redis. The Redis key will be a combination of the `keyPrefix` and the `revisionKey`. By default this option will use the `project.name()` property from the deployment context.
100+
101+
*Default:* `context.project.name() + ':index'`
102+
103+
### revisionKey
104+
105+
The unique revision number for the version of the file being uploaded to Redis. The Redis key will be a combination of the `keyPrefix` and the `revisionKey`. By default this option will use either the `revisionKey` passed in from the command line or the `revisionKey` property from the deployment context.
106+
107+
*Default:* `context.commandLineArgs.revisionKey || context.revisionKey`
108+
109+
### redisDeployClient
110+
111+
The Redis client to be used to upload files to the Redis store. By default this option will use a new instance of the [Redis][3] client unless another client is provided in the `redisDeployClient` property of the deployment context. This allows for injection of a mock client for testing purposes.
112+
113+
*Default:* `context.redisDeployClient || new Redis(context.config.redis)`
114+
115+
### didDeployMessage
116+
117+
A message that will be displayed after the file has been successfully uploaded to Redis. By default this message will only display if the revision for `revisionKey` of the deployment context has been activated.
118+
119+
*Default:*
120+
121+
```javascript
122+
if (context.revisionKey && !context.activatedRevisionKey) {
123+
return "Deployed but did not activate revision " + context.revisionKey + ". "
124+
+ "To activate, run: "
125+
+ "ember deploy:activate " + context.revisionKey + " --environment=" + context.deployEnvironment + "\n";
126+
}
127+
```
128+
129+
## Prerequisites
130+
131+
The following properties are expected to be present on the deployment `context` object:
132+
133+
- `distDir` (provided by [ember-cli-deploy-build][4])
134+
- `project.name()` (provided by [ember-cli-deploy][5])
135+
- `revisionKey` (provided by [ember-cli-deploy-revision-key][6])
136+
- `commandLineArgs.revisionKey` (provided by [ember-cli-deploy][5])
137+
- `deployEnvironment` (provided by [ember-cli-deploy][5])
138+
139+
## Running Tests
22140

23-
* `ember build`
141+
- `npm test`
24142

25-
For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
143+
[1]: https://github.com/lukemelia/ember-cli-deploy-lightning-pack "ember-cli-deploy-lightning-pack"
144+
[2]: http://ember-cli.github.io/ember-cli-deploy/plugins "Plugin Documentation"
145+
[3]: https://www.npmjs.com/package/redis "Redis Client"
146+
[4]: https://github.com/zapnito/ember-cli-deploy-build "ember-cli-deploy-build"
147+
[5]: https://github.com/ember-cli/ember-cli-deploy "ember-cli-deploy"
148+
[6]: https://github.com/zapnito/ember-cli-deploy-revision-key "ember-cli-deploy-revision-key"

0 commit comments

Comments
 (0)