premasagar / pablo

Pablo is a lightweight, expressive JavaScript SVG library. Pablo creates interactive drawings with SVG (Scalable Vector Graphics), giving access to all of SVG's granularity and power.
https://pablojs.com
MIT License
413 stars 16 forks source link

Add Grunt task to add /downloads and /tests in the gh-pages branch #67

Closed premasagar closed 10 years ago

premasagar commented 11 years ago
AaronAcerboni commented 11 years ago

This seems useful https://github.com/rubenv/grunt-git https://github.com/mikaelkaron/grunt-git-describe https://github.com/thanpolas/grunt-github-pages (possibly) https://github.com/jharding/grunt-exec

AaronAcerboni commented 11 years ago

I suppose then there will be no need for a dist folder in master?

AaronAcerboni commented 11 years ago

https://github.com/dharmafly/pablo/tree/gruntTask

There is a new grunt task which executes git commands which:

  1. Stash local changes on current branch
  2. Checkout gh-pages
  3. Overwrite tests, pablo.min and pablo
  4. Commits changes
  5. Checks back to master previous branch
  6. Pops stash
  7. Instructs developer to do git push origin gh-pages

(The script assumes you grunt off master branch)

It's not finished yet because of a bug which prevents commits to happen on the gh-pages. I'm assuming something incorrect happens with the git commands as the grunt tasks finishes without errors.

If there are no changes when the files are overwritten (i.e. no changes) then the git commands check back to master successful.

The grunt task pauses for 3 seconds between each git command. This is temporary to help with debugging.

If you want to test yourself:

$ cd build
$ grunt

(Try first with no changes made and with changes made)

premasagar commented 11 years ago

Great. Would be good if it didn't assume master branch - i.e. it can build from any branch into gh-pages, and then return to the branch.

Premasagar Rose, Dharmafly http://dharmafly.com dharmafly.com / 07941 192398 premasagar.com twitter.com/premasagar L4RP.com asyncjs.com

AaronAcerboni commented 11 years ago

Yeah sure, I don't think it would be that hard. I would probably need to use a git library or maybe look at the local git file which probably says the current branch a person is in.

AaronAcerboni commented 11 years ago

Great. Would be good if it didn't assume master branch - i.e. it can build from any branch into gh-pages, and then return to the branch.

7566feef7a58badeb4438c29b12daa4490196bd2

It now checks back to the current branch not always master

premasagar commented 11 years ago

Having a Grunt task that creates a dist folder containing the min.js would still be useful. But the task that updates the gh-pages branch is separate from this and should not create a dist folder.

Premasagar Rose, Dharmafly http://dharmafly.com dharmafly.com / 07941 192398 premasagar.com twitter.com/premasagar L4RP.com asyncjs.com

AaronAcerboni commented 11 years ago

Having a Grunt task that creates a dist folder containing the min.js would still be useful. But the task that updates the gh-pages branch is separate from this and should not create a dist folder.

Implemented in 5f3dd8a04c56c2cfe32910e763a5abfc06499c82 (gruntTask branch).

You can now do grunt dist which creates a dist folder in the project directory with pablo.min.js inside it.

Doing just grunt will do the task mentioned above with the gh pages.