forked from abuiles/facturas-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
62 lines (62 loc) · 1.71 KB
/
Gruntfile.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
52
53
54
55
56
57
58
59
60
61
62
module.exports = function(grunt) {
grunt.initConfig({
env: grunt.file.readJSON('.env'),
s3: {
options: {
key: '<%= env.AWS_ACCESS_KEY_ID %>',
secret: '<%= env.AWS_SECRET_ACCESS_KEY %>',
bucket: '<%= env.AWS_BUCKET %>',
access: 'public-read',
headers: {
"Cache-Control": "max-age=630720000, public",
"Expires": new Date(Date.now() + 630720000).toUTCString()
}
},
dev: {
upload: [
{
src: 'dist/assets/**/*',
dest: 'facturas-client/assets/',
rel: 'dist/assets',
options: { verify: true }
}
]
}
},
redis: {
options: {
manifestKey: 'releases',
manifestSize: 10,
host: '<%= env.REDISTOGO.host %>',
port: '<%= env.REDISTOGO.port %>',
connectionOptions: {
auth_pass: '<%= env.REDISTOGO.password %>'
}
},
canary: {
options: {
prefix: '<%= gitinfo.local.branch.current.shortSHA %>:',
currentDeployKey: '<%= gitinfo.local.branch.current.shortSHA %>',
},
files: {
src: ["dist/index.html"]
}
},
release: {
options: {
prefix: 'release:'
},
files: {
src: ["dist/index.html"]
}
}
},
});
grunt.loadNpmTasks('grunt-gitinfo');
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-redis');
grunt.registerTask('release', ['gitinfo', 'redis:release']);
grunt.registerTask('canary', ['gitinfo', 'redis:canary']);
grunt.registerTask('publish-release', ['default', 'release']);
return grunt.registerTask('default', ['gitinfo', 's3:dev', 'canary']);
};