You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Alexander Gabriel <al...@barbalex.ch> on 2014/09/11 13:20:05 UTC

Re: How to integrate a couchapp into a build-tool

I found a better solution that integrates nicely with gulp, in case someone
else needs it:

Use gulp-shell (https://www.npmjs.org/package/gulp-shell) to run the
couchapp build command from gulp, like this:

gulp.task('build_couchapp', shell.task(['couchapp push
http://user:password@127.0.0.1:5984/mydb']));


2014-06-10 16:29 GMT+02:00 Alexander Gabriel <al...@barbalex.ch>:

> Thanks!
>
> Meantime I've configured gulp to run some tasks parallel to the python
> couchapp tool. Gulp is so easy, even I grasped it (just like couchdb).
>
> This seems to work fine so far.  But I will change to a gulp plugin when
> one gets available.
>
> Alex
> Am 10.06.2014 11:57 schrieb "Johannes Jörg Schmidt" <schmidt@netzmerk.com
> >:
>
> Hi Alex,
>>
>> I wrote grunt-couch [1] and we use it for all our projects. The base
>> has been extracted as a standalone module which is meant to be
>> integrated in other build tools, eg Gulp.
>>
>> Johannes
>>
>> [1]: https://github.com/jo/grunt-couch
>> [2]: https://github.com/jo/couch-compile
>>
>> 2014-06-09 22:54 GMT+02:00 Alexander Gabriel <al...@barbalex.ch>:
>> > Hy coucher's
>> >
>> > Warning: Cross-posted because the couchapp-list seems dead.
>> >
>> > I've been using the python couchapp tool now for quite a while and am
>> happy
>> > with it.
>> >
>> > But I see all these nice examples of how to automate building with gulp
>> and
>> > grunt. With all the goodies like concatenating, live previews etc. And
>> I'm
>> > using gulp successfully in a non-couchapp-project. Love the piping.
>> >
>> > Being a relative noob I haven't done any automated testing yet. I want
>> to
>> > start now. I haven't decided on a favorite tool yet - probably any one
>> > would do as long as I can integrate it with building a couchapp.
>> >
>> > All examples and tutorials I've seen show how to build and test when
>> using
>> > grunt or gulp.
>> >
>> > Here come the questions:
>> >
>> >    - What would I have to do differently when using a couchapp?
>> >    - Is there a grunt or gulp tool that can replace the python couchapp
>> >    tool? How would one migrate an existing couchapp?
>> >    - Do you know of any example or tutorial?
>> >
>> > Thanks a lot for pointers!
>> >
>> > By the way: I work on Windows 8 which I believe excludes some other
>> > couchapp-tools that may have some of the mentioned capabilities.
>> >
>> > Alex
>>
>

Re: How to integrate a couchapp into a build-tool

Posted by Alexander Gabriel <al...@barbalex.ch>.
better yet: put username and password into a separate json-file, that isn't
checked into git.

I use a file called '.couchpass.json':
{
    "user": "username",
    "pass": "password"
}

My gulp task is now:

var gulp = require('gulp'),
    shell = require('gulp-shell'),
    pass_file = require('./.couchpass.json'),
    user_name,
    password,
    request;

user_name = pass_file.user;
password = pass_file.pass;

request = 'couchapp push http://' + user_name + ':' + password + '@
127.0.0.1:5984/evab';

return gulp.task('build_couchapp', shell.task([request]));



2014-09-11 13:20 GMT+02:00 Alexander Gabriel <al...@barbalex.ch>:

> I found a better solution that integrates nicely with gulp, in case
> someone else needs it:
>
> Use gulp-shell (https://www.npmjs.org/package/gulp-shell) to run the
> couchapp build command from gulp, like this:
>
> gulp.task('build_couchapp', shell.task(['couchapp push
> http://user:password@127.0.0.1:5984/mydb']));
>
>
> 2014-06-10 16:29 GMT+02:00 Alexander Gabriel <al...@barbalex.ch>:
>
>> Thanks!
>>
>> Meantime I've configured gulp to run some tasks parallel to the python
>> couchapp tool. Gulp is so easy, even I grasped it (just like couchdb).
>>
>> This seems to work fine so far.  But I will change to a gulp plugin when
>> one gets available.
>>
>> Alex
>> Am 10.06.2014 11:57 schrieb "Johannes Jörg Schmidt" <schmidt@netzmerk.com
>> >:
>>
>> Hi Alex,
>>>
>>> I wrote grunt-couch [1] and we use it for all our projects. The base
>>> has been extracted as a standalone module which is meant to be
>>> integrated in other build tools, eg Gulp.
>>>
>>> Johannes
>>>
>>> [1]: https://github.com/jo/grunt-couch
>>> [2]: https://github.com/jo/couch-compile
>>>
>>> 2014-06-09 22:54 GMT+02:00 Alexander Gabriel <al...@barbalex.ch>:
>>> > Hy coucher's
>>> >
>>> > Warning: Cross-posted because the couchapp-list seems dead.
>>> >
>>> > I've been using the python couchapp tool now for quite a while and am
>>> happy
>>> > with it.
>>> >
>>> > But I see all these nice examples of how to automate building with
>>> gulp and
>>> > grunt. With all the goodies like concatenating, live previews etc. And
>>> I'm
>>> > using gulp successfully in a non-couchapp-project. Love the piping.
>>> >
>>> > Being a relative noob I haven't done any automated testing yet. I want
>>> to
>>> > start now. I haven't decided on a favorite tool yet - probably any one
>>> > would do as long as I can integrate it with building a couchapp.
>>> >
>>> > All examples and tutorials I've seen show how to build and test when
>>> using
>>> > grunt or gulp.
>>> >
>>> > Here come the questions:
>>> >
>>> >    - What would I have to do differently when using a couchapp?
>>> >    - Is there a grunt or gulp tool that can replace the python couchapp
>>> >    tool? How would one migrate an existing couchapp?
>>> >    - Do you know of any example or tutorial?
>>> >
>>> > Thanks a lot for pointers!
>>> >
>>> > By the way: I work on Windows 8 which I believe excludes some other
>>> > couchapp-tools that may have some of the mentioned capabilities.
>>> >
>>> > Alex
>>>
>>
>