-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.js
More file actions
59 lines (57 loc) · 2.12 KB
/
Copy pathdeploy.js
File metadata and controls
59 lines (57 loc) · 2.12 KB
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
58
59
/* eslint-env node */
'use strict';
module.exports = function(deployTarget) {
let ENV = {
build: {
environment: 'production'
},
pipeline: {
// This setting runs the ember-cli-deploy activation hooks on every deploy
// which is necessary in order to run ember-cli-deploy-cloudfront.
// To disable CloudFront invalidation, remove this setting or change it to `false`.
// To disable ember-cli-deploy-cloudfront for only a particular environment, add
// `ENV.pipeline.activateOnDeploy = false` to an environment conditional below.
activateOnDeploy: true
},
cloudformation: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID, // SET THE ENV VAR
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, // SET THE ENV VAR
region: 'us-east-1',
stackName: `${require('../package.json').name}-${deployTarget}`,
templateBody: 'file://cfn.yaml',
capabilities: ['CAPABILITY_IAM'],
parameters: {
DomainName: process.env.CFN_DOMAINNAME, // SET THE ENV VAR OR REPLACE!
CFCertificate: process.env.CFN_CFCERTIFICATE // SET THE ENV VAR OR REPLACE!
}
},
s3: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
bucket(context) {
return context.cloudformation.outputs.AssetsBucket;
},
region: 'us-east-1'
},
's3-index': {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
bucket(context) {
return context.cloudformation.outputs.AssetsBucket;
},
region: 'us-east-1',
filePattern: 'index.html'
},
cloudfront: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
distribution(context) {
return context.cloudformation.outputs.CloudFrontDistribution;
}
}
};
// Note: if you need to build some configuration asynchronously, you can return
// a promise that resolves with the ENV object instead of returning the
// ENV object synchronously.
return ENV;
};