1
0
mirror of https://github.com/kremalicious/appstorebadges.git synced 2024-11-22 01:37:13 +01:00

deploy task

This commit is contained in:
Matthias Kretschmann 2015-09-13 21:40:06 +02:00
parent 570087a331
commit eba08159de
2 changed files with 36 additions and 3 deletions

View File

@ -21,7 +21,10 @@ var onError = function(error) {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
var src = 'src/', var src = 'src/',
dist = 'dist/'; dist = 'dist/',
s3bucket = 'lab.kremalicious.com',
s3path = '/appstorebadges/',
s3region = 'eu-central-1';
// code banner // code banner
@ -112,3 +115,32 @@ gulp.task('default', ['css', 'html', 'watch', 'connect']);
// Full build // Full build
// //
gulp.task('build', ['css', 'html']); gulp.task('build', ['css', 'html']);
//
// Deploy to S3
//
gulp.task('deploy', function() {
var publisher = $.awspublish.create({
params: {
'Bucket': s3bucket
},
'region': s3region
});
// define custom headers
var headers = {
'Cache-Control': 'max-age=315360000, no-transform, public',
'x-amz-acl': 'public-read'
};
return gulp.src(dist + '*')
.pipe($.rename(function (path) {
path.dirname += s3path;
}))
.pipe($.awspublish.gzip({ ext: '' })) // gzip all the things
.pipe(publisher.publish(headers))
.pipe($.awspublish.reporter({
states: ['create', 'update', 'delete']
}));
});

View File

@ -1,6 +1,6 @@
{ {
"name": "appstorebadges", "name": "appstorebadges",
"version": "1.0.0", "version": "0.0.9",
"author": { "author": {
"name": "Matthias Kretschmann", "name": "Matthias Kretschmann",
"email": "m@kretschmann.io" "email": "m@kretschmann.io"
@ -17,13 +17,14 @@
"gulp": ">=3.8.0", "gulp": ">=3.8.0",
"gulp-assemble": ">=0.3.2", "gulp-assemble": ">=0.3.2",
"gulp-autoprefixer": ">=2.3.0", "gulp-autoprefixer": ">=2.3.0",
"gulp-awspublish": ">=3.0.0",
"gulp-connect": ">=2.0.5", "gulp-connect": ">=2.0.5",
"gulp-cssmin": ">=0.1.7", "gulp-cssmin": ">=0.1.7",
"gulp-extname": ">=0.2.0", "gulp-extname": ">=0.2.0",
"gulp-header": "^1.7.1", "gulp-header": "^1.7.1",
"gulp-htmlmin": ">=1.1.4", "gulp-htmlmin": ">=1.1.4",
"gulp-load-plugins": ">=0.10.0", "gulp-load-plugins": ">=0.10.0",
"gulp-rename": "^1.2.2", "gulp-rename": ">=1.2.2",
"gulp-stylus": ">=2.0.6", "gulp-stylus": ">=2.0.6",
"gulp-util": ">=3.0.6", "gulp-util": ">=3.0.6",
"normalize.css": "^3.0.3" "normalize.css": "^3.0.3"