tonifisler / generator-styleguide

A Yeoman Generator for a Hologram Styleguide with Bootstrap Sass starting files.
MIT License
23 stars 6 forks source link

Gulp deploy fail #26

Closed Yago closed 9 years ago

Yago commented 9 years ago

The deploy task doesn't work well. I have something like :

[10:57:52] Using gulpfile ~/Sites/project/gulpfile.js
[10:57:52] Starting 'deploy'...
[10:57:52] Finished 'deploy' after 83 ms
[10:57:52] [gulp-gh-pages]: Cloning repo
[10:57:52] [gulp-gh-pages]: Checkout branch `gh-pages`

/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/decorators/unhandledRejection.js:100
    throw e;
          ^
Error: Error: stdout maxBuffer exceeded.
    at /Users/Myself/Sites/project/node_modules/gulp-gh-pages/index.js:143:10
    at tryCatchReject (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:840:30)
    at runContinuation1 (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:799:4)
    at Rejected.when (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:623:4)
    at Pending.run (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:481:13)
    at Scheduler._drain (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/Scheduler.js:62:19)
    at Scheduler.drain (/Users/Myself/Sites/project/node_modules/gulp-gh-pages/node_modules/when/lib/Scheduler.js:27:9)
    at process._tickCallback (node.js:419:13)

I fix the issue by using an old version of gulp-gh-pages

"gulp-gh-pages": "^0.3.3"

and rewriting the deploy task :

var deploy = require("gulp-gh-pages"),
    options = { 
      remoteUrl: "git@github.com:user/repo.git",
      branch: "gh-pages"};

/**
 * Deploy to GH pages
 */

gulp.task('deploy', function () {
    gulp.src("styleguide/**/*.*")
        .pipe(deploy(options));
});

Maybe there is something to do in this way :wink:

Yago commented 9 years ago

In fact, the task works also with the current version of gulp-gh-pages. No need to downgrade :+1:

tonifisler commented 9 years ago

It's working perfectly well if you set correctly the upstream branch of your current branch.

As said in the gulp-gh-pages docs:

By default gulp-gh-pages assumes the current working directory is a git repository and uses its remote url. If your gulpfile.js is not in a git repository, or if you want to push to a different remote url, you can specify it. Ensure you have write access to the repository. https://github.com/rowoot/gulp-gh-pages#optionsremoteurl