forked from ember-learn/builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
51 lines (44 loc) · 1.35 KB
/
deploy.js
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
/* eslint-env node */
module.exports = function(deployTarget) {
var ENV = {
build: {},
exclude: ['.DS_Store', '*-test.js'],
gzip: {
filePattern: '**/*.{js,css,ico,map,xml,txt,svg,eot,ttf,woff,woff2}'
},
pipeline: {
activateOnDeploy: true
}
};
ENV['s3'] = {
accessKeyId: process.env.accessKeyId,
secretAccessKey: process.env.secretAccessKey,
bucket: process.env.bucket,
region: process.env.region,
prefix: "releases"
};
ENV['s3-index'] = {
accessKeyId: process.env.accessKeyId,
secretAccessKey: process.env.secretAccessKey,
bucket: process.env.bucket,
region: process.env.region,
prefix: "releases",
filePattern: 'index.json'
};
if (deployTarget === 'development') {
ENV.build.environment = 'development';
// configure other plugins for development deploy target here
}
if (deployTarget === 'staging') {
ENV.build.environment = 'production';
// configure other plugins for staging deploy target here
}
if (deployTarget === 'production') {
ENV.build.environment = 'production';
// configure other plugins for production deploy target here
}
// 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;
};