react-china / collections

React resources
http://react.mvc.im/
16 stars 2 forks source link

ci build error #1

Closed fraserxu closed 10 years ago

fraserxu commented 10 years ago

Currently we have a deploy task in the gulpfile, what this does is when any team member push code to the repo, it will trigger the CI server to run the gulp deploy with webhook, and then the task will copy the deploy_files defined in the task, and use it to build the gh-page branch.

gulp.task 'deploy', ->
  deploy = require('gulp-gh-pages')

  deploy_files = [
    'index.html'
    'dist/*'
    'images/*'
  ]

  gulp
  .src deploy_files
  .pipe deploy()

But there's an error while execute the task as the gulp.src() will copy the file like this

├── index.html
├── main.min.css
├── main.min.js
└── vendor.min.js

But the path in the index.html for js and css is dist/main.min.css which will fail to load the correct file.

Need to fix.

/cc @undoZen @jiyinyiyong

fraserxu commented 10 years ago

Error log:

[15:27:53] Requiring external module coffee-script/register
[15:27:53] Using gulpfile ~/src/github.com/react-china/collections/gulpfile.coffee
[15:27:53] Starting 'deploy'...
[15:27:53] [gulp-gh-pages]: Cloning repo
[15:27:53] [gulp-gh-pages]: Checkout remote branch `gh-pages`
[15:27:53] [gulp-gh-pages]: Copying files to repository
[15:27:53] [gulp-gh-pages]: Adding 1 files.
[15:27:53] [gulp-gh-pages]: Commiting "Update 2014-09-18T15:27:53.955Z"

/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/decorators/unhandledRejection.js:96
        throw e;
              ^
Error: Error: Command failed: 
*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <rof@railsonfire_35387e80-2176-0132-d510-26158984ebbc_a3038a9d1335.(none)>) not allowed

at /home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/index.js:142:10
at tryCatchReject (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:758:30)
at runContinuation1 (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:728:4)
at Rejected.when (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:577:4)
at Pending.run (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/makePromise.js:438:13)
at runQueue (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/Scheduler.js:75:18)
at Scheduler._drain (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/Scheduler.js:50:3)
at Scheduler.drain (/home/rof/src/github.com/react-china/collections/node_modules/gulp-gh-pages/node_modules/when/lib/Scheduler.js:26:9)
at process._tickCallback (node.js:415:13)

@jiyinyiyong seems that your git config has not set on the machine yet.

tiye commented 10 years ago

Yes.. and I think it might be better idea if I update gh-pages by hand.

fraserxu commented 10 years ago

I'm trying to fixed it.

fraserxu commented 10 years ago

Found this: https://github.com/gulpjs/gulp/issues/151

tiye commented 10 years ago

Yes, I forgot to try that option. Would you like to try that?

tiye commented 10 years ago

@fraserxu I found this repo connected with CodeShip, which is I'm not familiar with.. It says:

This repository is already set up. Please ask the project owner to invite you!

And that log belongs to the CI machine rather than mine.

fraserxu commented 10 years ago

I have invited both you @jiyinyiyong and @undoZen . You haven't get the invitation?

undoZen commented 10 years ago

What’s invatation? Just got mention notification.

On Sep 19, 2014, at 8:30 AM, xvfeng notifications@github.com wrote:

I have invited both you @jiyinyiyong and @undoZen . You haven't get the invitation?

— Reply to this email directly or view it on GitHub.

fraserxu commented 10 years ago

Invitation to codeship. Anyway, I will create one use the react-china account github account later.

tiye commented 10 years ago

There's still some problems, check Codeship please. I don't have a solution here.

tiye commented 10 years ago

Got some help from CodeShip about the SSH key problem:

when you create a new project on Codeship, we generate a SSH key for the project and add this key as a deploy key on GitHub. This key may clone the repository, but it isn't allowed to push changes back. To get this to work, you must create machine user. You need to remove the deploy key though, before you can add it to another user.

If you want to switch from a HTTPS URL to a SSH URL, you can simply delete the remote and re add it during either setup or deployment steps.

https://developer.github.com/guides/managing-deploy-keys/#machine-users

fraserxu commented 10 years ago

Still got problem with the CI. Seems the gulp-gh-pages has certain limit for multiple users. I've removed it from the task.

For now I just set the gh-pages as the main branch of this repo. And we can simply run gulp build to generate the needed file(index.html, dist/, images) to serve the page(not clean, but works).

We could reopen this if needed.

Closing this for now...