Skip to content

Commit b4aaba9

Browse files
author
Aaron Chambers
committed
Merge pull request #10 from strange-studios/update-readme-for-0.5.0
Updated README for 0.5.0
2 parents 076f35e + f71c639 commit b4aaba9

File tree

3 files changed

+151
-16
lines changed

3 files changed

+151
-16
lines changed

README.md

Lines changed: 149 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,160 @@
1-
# Ember-cli-deploy-s3
1+
# ember-cli-deploy-s3
22

3-
This README outlines the details of collaborating on this Ember addon.
3+
> An ember-cli-deploy plugin to upload files to S3
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 one or more files to an Amazon S3 bucket. It could be used to upload the assets (js, css, images etc) or indeed the application's index.html.
10+
11+
## What is an ember-cli-deploy plugin?
12+
13+
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.
14+
15+
For more information on what plugins are and how they work, please refer to the [Plugin Documentation][1].
16+
17+
## Quick Start
18+
19+
To get up and running quickly, do the following:
20+
21+
- Ensure [ember-cli-deploy-build][2] is installed and configured.
22+
23+
- Install this plugin
24+
25+
```bash
26+
$ ember install ember-cli-deploy-s3
27+
```
28+
29+
- Place the following configuration into `config/deploy.js`
30+
31+
```javascript
32+
ENV.s3 {
33+
accessKeyId: '<your-aws-access-key>',
34+
secretAccessKey: '<your-aws-secret>',
35+
bucket: '<your-s3-bucket>',
36+
region: '<the-region-your-bucket-is-in>'
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-s3
51+
```
1052

11-
## Running
53+
## ember-cli-deploy Hooks Implemented
1254

13-
* `ember server`
14-
* Visit your app at http://localhost:4200.
55+
For detailed information on what plugin hooks are and how they work, please refer to the [Plugin Documentation][1].
1556

16-
## Running Tests
57+
- `configure`
58+
- `upload`
59+
60+
## Configuration Options
61+
62+
For detailed information on how configuration of plugins works, please refer to the [Plugin Documentation][1].
63+
64+
### accessKeyId (`required`)
65+
66+
The AWS access key for the user that has the ability to upload to the `bucket`.
67+
68+
*Default:* `undefined`
69+
70+
### secretAccessKey (`required`)
71+
72+
The AWS secret for the user that has the ability to upload to the `bucket`.
73+
74+
*Default:* `undefined`
75+
76+
### bucket (`required`)
77+
78+
The AWS bucket that the files will be uploaded to.
79+
80+
*Default:* `undefined`
81+
82+
### region (`required`)
83+
84+
The region the AWS `bucket` is located in.
85+
86+
*Default:* `us-east-1`
87+
88+
### prefix
1789

18-
* `ember test`
19-
* `ember test --server`
90+
A directory within the `bucket` that the files should be uploaded in to.
2091

21-
## Building
92+
*Default:* `''`
93+
94+
### filePattern
95+
96+
Files that match this pattern will be uploaded to S3. The file pattern must be relative to `distDir`.
97+
98+
*Default:* '**/*.{js,css,png,gif,jpg,map,xml,txt,svg,eot,ttf,woff,woff2}'
99+
100+
### distDir
101+
102+
The root directory where the files matching `filePattern` will be searched for. By default, this option will use the `distDir` property of the deployment context, provided by [ember-cli-deploy-build][2].
103+
104+
*Default:* `context.distDir`
105+
106+
### distFiles
107+
108+
The list of built project files. This option should be relative to `distDir` and should include the files that match `filePattern`. By default, this option will use the `distFiles` property of the deployment context, provided by [ember-cli-deploy-build][2].
109+
110+
*Default:* `context.distDir`
111+
112+
### gzippedFiles
113+
114+
The list of files that have been gziped. This option should be relative to `distDir`. By default, this option will use the `gzippedFiles` property of the deployment context, provided by [ember-cli-deploy-gzip][3].
115+
116+
This option will be used to determine which files in `distDir`, that match `filePattern`, require the gzip content encoding when uploading.
117+
118+
*Default:* `context.gzippedFiles`
119+
120+
### manifestPath
121+
122+
The path to a manifest that specifies the list of files that are to be uploaded to S3.
123+
124+
This manifest file will be used to work out which files don't exist on S3 and, therefore, which files should be uploaded. By default, this option will use the `manifestPath` property of the deployment context, provided by [ember-cli-deploy-manifest][4].
125+
126+
*Default:* `context.manifestPath`
127+
128+
### uploadClient
129+
130+
The client used to upload files to S3. This allows the user the ability to use their own client for uploading instead of the one provided by this plugin.
131+
132+
The client specified MUST implement a function called `upload`.
133+
134+
*Default:* the upload client provided by ember-cli-deploy-s3
135+
136+
### s3Client
137+
138+
The underlying S3 library used to upload the files to S3. This allows the user to use the default upload client provided by this plugin but switch out the underlying library that is used to actually send the files.
139+
140+
The client specified MUST implement functions called `getObject` and `putObject`.
141+
142+
*Default:* the default S3 library is `aws-sdk`
143+
144+
## Prerequisites
145+
146+
The following properties are expected to be present on the deployment `context` object:
147+
148+
- `distDir` (provided by [ember-cli-deploy-build][2])
149+
- `distFiles` (provided by [ember-cli-deploy-build][2])
150+
- `gzippedFiles` (provided by [ember-cli-deploy-gzip][3])
151+
- `manifestPath` (provided by [ember-cli-deploy-manifest][4])
152+
153+
## Running Tests
22154

23-
* `ember build`
155+
- `npm test`
24156

25-
For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
157+
[1]: http://ember-cli.github.io/ember-cli-deploy/plugins "Plugin Documentation"
158+
[2]: https://github.com/zapnito/ember-cli-deploy-build "ember-cli-deploy-build"
159+
[3]: https://github.com/lukemelia/ember-cli-deploy-gzip "ember-cli-deploy-gzip"
160+
[4]: https://github.com/lukemelia/ember-cli-deploy-manifest "ember-cli-deploy-manifest"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"aws-sdk": "^2.1.25",
4646
"chalk": "^1.0.0",
4747
"core-object": "^1.1.0",
48-
"ember-cli-deploy-plugin": "0.1.1",
48+
"ember-cli-deploy-plugin": "0.1.3",
4949
"ember-cli-babel": "^5.0.0",
5050
"lodash": "^3.9.3",
5151
"mime": "^1.3.4",

tests/unit/index-nodetest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('s3 plugin', function() {
134134
plugin.configure(context);
135135
});
136136
var messages = mockUi.messages.reduce(function(previous, current) {
137-
if (/- Missing config:\s.*/.test(current)) {
137+
if (/- Missing required config:\s.*/.test(current)) {
138138
previous.push(current);
139139
}
140140

0 commit comments

Comments
 (0)