clineamb / gulp-s3-upload

A gulp task to upload/update assets to an S3 account.
62 stars 37 forks source link

Gulp-s3-upload breaks pipe #37

Closed subinsebastien closed 8 years ago

subinsebastien commented 8 years ago

A very simple gulptask, where s3-upload breaks the pipe.

// Dependencies
var s3Download    = require("gulp-download");
var s3Upload      = require('gulp-s3-upload')(config); //config is aws config

// Task
gulp.task('default', function() {
    s3Download(url)
    .pipe(imageResize({
        width: 300,
        upscale: true,
        format: 'jpeg'
    }))
    .pipe(rename({
        dirname: "resized",
        basename: "baseName",
        prefix: "",
        suffix: "-300px"
    }))
    .pipe(s3Upload({
        Bucket: 'mybucket',
        ACL:    'public-read',
    }, {
        maxRetries: 5
    }))
    .pipe(gulp.dest('./dist'));
});

The last operation in the pipeline (saving the file to ./dist) never happens. Which most likely means, at the upload pipe does not return the stream properly.

clineamb commented 8 years ago

A temporary work around for this should be to move the gulp.dist() before uploading. I'll take a look into proper stream returning.

subinsebastien commented 8 years ago

Actually, having a gulp.dist() will involve a write-to-disk, which I would say is not efficient. We can deal with the in-memory stream to fix this, I guess.

clineamb commented 8 years ago

@subinsebastien Did you find a fix for this? Let me know if I can help with this or if my comment in #36 works.