Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration bower install with Jenkins #525

Closed
thomaspons opened this issue Jun 3, 2013 · 19 comments
Closed

Integration bower install with Jenkins #525

thomaspons opened this issue Jun 3, 2013 · 19 comments

Comments

@thomaspons
Copy link

The integration with Jenkins doesn't work : error code 128 !!

And the https hack doesn't work too ...

Any idea ?

Thx to you,

Tom

@wibblymat
Copy link
Member

What version of git is installed (git --version)?

@thomaspons
Copy link
Author

It's 1.7.10 version.

@wibblymat
Copy link
Member

Ok, lets back up a bit and get some more information then. What exactly are you seeing? Is there any output other than "error code 128"?

When on the box with Jenkins, what happens if you try a bower install jquery in a new project?

What exactly did you do for the "https hack"?

@thomaspons
Copy link
Author

This is the complete stacktrace

C:\Program Files (x86)\Jenkins\indus>bower install
bower �[33mwarn�[39m Using deprecated "component.json". Please use "bower.json" instead
bower �[36mcloning�[39m git://github.com/kriskowal/es5-shim
bower �[36mcaching�[39m git://github.com/kriskowal/es5-shim
bower �[36mcloning�[39m git://github.com/angular/bower-angular-cookies.git
bower �[36mcloning�[39m git://github.com/angular/bower-angular.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular-cookies.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular.git
bower �[36mcloning�[39m git://github.com/bestiejs/json3.git
bower �[36mcaching�[39m git://github.com/bestiejs/json3.git
bower �[31merror�[39m status code of git: 128
bower �[36mcloning�[39m git://github.com/angular/bower-angular-resource.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular-resource.git
bower �[36mcloning�[39m git://github.com/angular/bower-angular-sanitize.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular-sanitize.git
bower �[36mcloning�[39m git://github.com/angular/bower-angular-scenario.git
bower �[31merror�[39m status code of git: 128
bower �[36mcloning�[39m git://github.com/angular/bower-angular-mocks.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular-scenario.git
bower �[36mcaching�[39m git://github.com/angular/bower-angular-mocks.git
bower �[31merror�[39m status code of git: 128
bower �[31merror�[39m status code of git: 128
bower �[31merror�[39m status code of git: 128
bower �[31merror�[39m status code of git: 128
bower �[31merror�[39m status code of git: 128
bower �[31merror�[39m status code of git: 128

�For the hack it's just the command line : git config --global url."https://".insteadOf git://

@tfitch
Copy link

tfitch commented Jun 4, 2013

Can you verify the config change was applied to the jenkins user's git account. Just running the git config --global url."https://".insteadOf git:// on the machine won't apply it for everyone. It has to be run by jenkins.

So when, running as the jenkins user, you run git config --list is url.https://.insteadof=git:// in the list of config changes for Jenkins?

@thomaspons
Copy link
Author

It's in the list for the Jenkins user ...

url.https://.insteadof=git://

In fact this config is in the git config file project so it's everywhere for all users ...

@thomaspons
Copy link
Author

Update : it works if Jenkins is on a linux server ! But not on a windows server :/

@mallim
Copy link

mallim commented Jun 12, 2013

I have no problem running bower under Jenkins.

  1. If Jenkins is running under a Windows Service, make sure it is logon as Administrator or equivalent user
  2. Make sure the Administrator account or equivalent user can run bower install on command line

@satazor
Copy link
Member

satazor commented Jul 10, 2013

Follow @mallim suggestions, I will reopen if necessary.

@satazor satazor closed this as completed Jul 10, 2013
@sebastiendavid
Copy link

Hi, I cannot execute bower in Jenkins environment:

+ bower install

path.js:360
        throw new TypeError('Arguments to path.join must be strings');
              ^
TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at Object.exports.join (path.js:358:36)
    at Object.<anonymous> (/usr/lib/node_modules/bower/node_modules/update-notifier/node_modules/configstore/configstore.js:9:7)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
Build step 'Execute shell' marked build as failure

Here my shell task:

npm install
bower install
grunt clean package

npm and grunt work...

I'm executing this in Jenkins on a CentOS 6 with bower 1.0.

Any ideas?

@SatadruBhattacharjee
Copy link

Hi , I am facing exactly the same problem mentioned by "sebastiendavid" with the same environment. Executing 'bower install' from terminal runs without any issue. But from Jenkins Environment is the problem.

@satazor
Copy link
Member

satazor commented Aug 5, 2013

@sebastiendavid this is a problem in the configstore module. I've submitted a PR: yeoman/configstore#7

@sebastiendavid
Copy link

Yes, if I set the HOME environment variable in Jenkins, it works.

Thanks!

@sindresorhus
Copy link
Contributor

this is a problem in the configstore module

No it's not, $HOME is an expected environment variable by most tools including git, tig, etc, but as usual we happily work around bugs in system configurations and other tools :)

I find it surprising that Jenkins doesn't set this for you. Sounds like a bug in Jenkins to me.

@SatadruBhattacharjee
Copy link

After setting the HOME env variable, It worked for me as well.

Thanks @sebastiendavid

If any 1 else is facing the same issue , just use
export HOME="/root" (I am running jenkins in root user, it may differ for you)
before executing "bower install"

@sindresorhus
Copy link
Contributor

Can anyone open a ticket on Jenkins about this?

@SatadruBhattacharjee
Copy link

@sindresorhus , Yup created an Issue on Jenkins
https://issues.jenkins-ci.org/browse/JENKINS-19094

@sreyd
Copy link

sreyd commented Oct 17, 2013

How to set HOME environment in Jenkins on Windows?

@allwinac
Copy link

It is been a very long time. but when I check this issue there is no solution given for Jenkins on windows. In my case I have Jenkins and Jenkins Slave installed on Windows Servers. I get the same issue with bower install
bower install jquery
bower jquery#* not-cached git://github.com/jquery/jquery-dist.git#*
bower jquery#* resolve git://github.com/jquery/jquery-dist.git#*
bower jquery#* ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery-dist.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: ...]: errno=No such file or directory

What I did to resolve, is the same solution that is given as resolution for #128.
git config --global url."https://".insteadOf git://

Only thing is I add this line before calling bower restore!. In my case I use, NPM, Gulp, bower integrated with .net MSBuild. So I added the above config command before calling MSbuild Rebuild.

This may not be the right solution. I am just a beginner. advice if there is anything other good solution.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

10 participants