Skip to content

Commit 6a9cd3f

Browse files
committed
finalize config
1 parent e44dd5e commit 6a9cd3f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

config/deploy.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
module.exports = function(deployTarget) {
44
var ENV = {
5-
build: {},
5+
build: {
6+
environment: 'production'
7+
},
68
pipeline: {
79
// This setting runs the ember-cli-deploy activation hooks on every deploy
810
// which is necessary in order to run ember-cli-deploy-cloudfront.
@@ -14,7 +16,8 @@ module.exports = function(deployTarget) {
1416
s3: {
1517
accessKeyId: process.env.AWS_KEY,
1618
secretAccessKey: process.env.AWS_SECRET,
17-
filePattern: "*"
19+
filePattern: "*",
20+
cacheControl: 'max-age=0, no-cache, public'
1821
},
1922
cloudfront: {
2023
accessKeyId: process.env.AWS_KEY,
@@ -27,20 +30,23 @@ module.exports = function(deployTarget) {
2730
ENV.s3.bucket = process.env.DEVELOPMENT_BUCKET;
2831
ENV.s3.region = process.env.DEVELOPMENT_REGION;
2932
ENV.cloudfront.distribution = process.env.DEVELOPMENT_DISTRIBUTION;
33+
ENV.pipeline.activateOnDeploy = false;
3034
}
3135

3236
if (deployTarget === 'staging') {
3337
ENV.build.environment = 'production';
3438
ENV.s3.bucket = process.env.STAGING_BUCKET;
3539
ENV.s3.region = process.env.STAGING_REGION;
3640
ENV.cloudfront.distribution = process.env.STAGING_DISTRIBUTION;
41+
ENV.pipeline.activateOnDeploy = false;
3742
}
3843

3944
if (deployTarget === 'production') {
4045
ENV.build.environment = 'production';
4146
ENV.s3.bucket = process.env.PRODUCTION_BUCKET;
4247
ENV.s3.region = process.env.PRODUCTION_REGION;
4348
ENV.cloudfront.distribution = process.env.PRODUCTION_DISTRIBUTION;
49+
ENV.pipeline.activateOnDeploy = false;
4450
}
4551

4652
// Note: if you need to build some configuration asynchronously, you can return

config/environment.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* jshint node: true */
22

33
module.exports = function(environment) {
4+
var deployTarget = process.env.DEPLOY_TARGET;
45
var ENV = {
56
modulePrefix: 'emberjs-talk-example',
6-
environment: environment,
7+
environment: deployTarget,
78
baseURL: '/',
89
locationType: 'auto',
910
EmberENV: {
@@ -39,8 +40,12 @@ module.exports = function(environment) {
3940
ENV.APP.rootElement = '#ember-testing';
4041
}
4142

42-
if (environment === 'production') {
43+
if (deployTarget === 'staging') {
44+
ENV.buildEnv = 'production';
45+
}
4346

47+
if (deployTarget === 'production') {
48+
ENV.buildEnv = 'production';
4449
}
4550

4651
return ENV;

0 commit comments

Comments
 (0)