ACRA / acralyzer

Open source backend for ACRA reports.
GNU General Public License v3.0
489 stars 90 forks source link

Build script #19

Closed halkeye closed 11 years ago

halkeye commented 11 years ago

Buildscript support - #14

Started out with yeoman webapp grunt file. Removed stuff we don't use.

Added a .couchapp_deploy file (optional) so grunt couchapp will deploy to the right place. Example options are (if not provided it'll use a localhost:5984 default):

{
  "port": 12345,
  "auth": "fake_username:fake_password",
  "hostname": "fake_hostname"
}

grunt watch will monitor for file changes and do a grunt jshint and/or grunt couchapp as appropriate

Down the road todo:

KevinGaudin commented 11 years ago

Awesome. But I don't think I'll be able to test all this before tonight (French time), don't hold your breath too long ;-)

halkeye commented 11 years ago

No worries. I'm on America/Pacific time. I'll be looking into either tarball or #17 next (tomorrow), maybe even #20. If you haven't merged by then, i'll just add onto this merge request.

KevinGaudin commented 11 years ago

Where am I supposed to setup connect.options.port required by the mocha task ?

halkeye commented 11 years ago

You can probably just add a connect: { options: { port: 8123} } } into the gruntfile inside the init block.

I kinda forgot that was in there. It was part of the original yeoman template. I am really not sure how unit tests are supposed to be setup using angular yet.

KevinGaudin commented 11 years ago

Ok. We'll see that later.

About the .couchapp_deploy, maybe we can just let couchapp use its .couchapprc file (see http://couchapp.org/page/couchapp-config), have it deploy to the 'default' env and specify another env (prod) on the command line when needed ?

halkeye commented 11 years ago

Oh! I was trying to find if they had a file to mange credentials. That works better. My only concern is that since .couchapprc is included in git, its very easy to accidentally commit. For now I can put the content in ~/.couchapp.conf but since the db name is included there, it doesn't seem like a great plan.

One solution to that is that grunt build and grunt couchapp could create empty files before trying to push/build and then not include .couchapprc in git?

Actually, what happens if we add .couchapprc to gitignore now? Will it keep it in the repo but make it hard to commit it?

KevinGaudin commented 11 years ago

I think we can git rm .couchapprc and add it to .gitignore.

halkeye commented 11 years ago

without the .couchapprc couchapp push reports [ERROR] couchapp error: You aren't in a couchapp. so you'd need at least the "{}" version. or at least be in setup instructions.

http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/ is the closest i could find to being useful.

Even in .gitignore, if a file is already tracked (committed/added at some point) it'll continue to be tracked.

KevinGaudin commented 11 years ago

Then I prefer adding complexity (documentation) to our developers process rather than Acralyzer users.

On another topic, when running a fresh grunt build the script/config.js file is not copied to dist/_attachments/script/config.js.

halkeye commented 11 years ago

So don't include .couchapprc in the root, but do add one to the dist directory? Or include it and suggest developers untrack it?

I'll look into config.js again right now. I was trying to exclude it from minification as it needs to be edited before install (I would like to change that eventually too)

KevinGaudin commented 11 years ago

I think we can include it and suggest developers to untrack it.

What would you suggest about the config.js ?

KevinGaudin commented 11 years ago

I just added ,'script/config.js' in copy.dist.files.src to fix the build.

halkeye commented 11 years ago

I think we can include it and suggest developers to untrack it.

Awesome. I'll pull out the weird couchapp code now.

What would you suggest about the config.js ?

I don't have a solution in mind yet. Right now i'm just fixing build script to include it as is. I'm thinking either it scans available dbs to start and picks one (meh), or store configs in couch itself (per user? and site wide?).

I just added ,'script/config.js' in copy.dist.files.src to fix the build.

I'm committing that right now.

KevinGaudin commented 11 years ago

This is another discussion but yes, I think we would better store the default app per user in couchdb. That was my initial idea but I started with this config.js to have something working early.

halkeye commented 11 years ago

This is another discussion but yes, I think we would better store the default app per user in couchdb. That was my initial idea but I started with this config.js to have something working early.

Agreed. I don't think it should hold up buildscript.

Merged fixes.

Also, for documentation purposes:

git update-index --assume-unchanged .couchapprc
git ls-files -v.couchapprc # <-- should be h not H
KevinGaudin commented 11 years ago

I just updated the build script with the following: