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

Configure proxy for Jenkins #343

Open
alibenmessaoud opened this issue Jul 31, 2019 · 1 comment
Open

Configure proxy for Jenkins #343

alibenmessaoud opened this issue Jul 31, 2019 · 1 comment

Comments

@alibenmessaoud
Copy link

alibenmessaoud commented Jul 31, 2019

Hello,

I don't know if it is duplicated or no but my question is about node downloading and the use of the proxy.
Well, my project has 2 modules, the first is frontend (React) and the second is backend (Java).
My goal is to package the React sources in the resource of the backend project.
Locally everything is fine but on Jenkins (Behind a proxy), errors are as shown below as the build fails:

> Task :frontend-bo:assemble
> Task :frontend-bo:compileTestJava NO-SOURCE
> Task :frontend-bo:processTestResources NO-SOURCE
> Task :frontend-bo:testClasses UP-TO-DATE
> Task :frontend-bo:test NO-SOURCE
> Task :frontend-bo:check UP-TO-DATE
> Task :frontend-bo:nodeSetup UP-TO-DATE

> Task :frontend-bo:npmSetup
npm ERR! code EHOSTUNREACH
npm ERR! errno EHOSTUNREACH
npm ERR! request to https://registry.npmjs.org/npm failed, reason: connect EHOSTUNREACH 104.16.22.35:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/.npm/_logs/2019-07-31T14_22_05_568Z-debug.log

> Task :frontend-bo:npmSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':frontend-bo:npmSetup'.
> Process 'command '/data/jenkins/workspace/commerce-frontend_PR-14-EBXQHC6O2GZBYJ73TBRYTBWUEEHVDY2LF2WNHVC2KAFDE6VHI3CQ/frontend-bo/.gradle/nodejs/node-v10.16.0-linux-x64/bin/node'' finished with non-zero exit value 1

It stays blocked on the Task :frontend-bo:npmSetup (npmSetup) task and it takes a long time before throwing the error. That's means it can't download npm from npmjs website.

Is there any way to configure the proxy on these tasks ?

I used this configuration too but it didn't work too.

Thanks.

@alibenmessaoud
Copy link
Author

I close this ticket after I found a solution by setting proxy settings in the Jenkinfile and it works.

node {
   ...
   env.HTTP_PROXY = "http://proxy.threatpulse.net:8080"
   env.HTTPS_PROXY = "http://proxy.threatpulse.net:8080"
   ...
}

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

No branches or pull requests

1 participant