Grunt task through Jenkins fails to commit to svn

615 Views Asked by At

I am creating buildinfo file using grunt task through Jenkins Job. process.env['BUILD_NUMBER'] ,process.env['SVN_REVISION'] are available and was able to create the file . and using chile_process to commit the file through svn. exec = require('child_process').exec, child;

     grunt.log.writeln("Commiting  buildinfo.js");
     child = exec("svn commit buildInfo.js -m 'jenkins is committing buildInfo' --username xxxxx --password xxxxxxxx",
        function (error, stdout, stderr) {
                    console.log('Error commiting Build Information file Error:' + error);
        });

commit works fine when i run it from terminal. but when i run it through jenkins job it throws no error but no commit happens. is something wrong... I tried using require('child_process').spawn this also does not commit whn i run it through jenkins woks fine from terminal though.

1

There are 1 best solutions below

0
On

I am now using grunt-exec that works perfectly.

https://npmjs.org/package/grunt-exec