Release Automation

  • 1.  Can I use a proxy to reach RA from the Jenkins plugin?

    Posted Oct 07, 2015 06:52 PM

    I'd like to trigger an RA deployment from Jenkins, but my Jenkins server is behind a firewall relative to my RA server. I can reach the RA server via a proxy and I'd like to configure a proxy for the Jenkins-RA plugin to allow Jenkins to reach RA. I've tried adding my proxy in the /etc/init.d/jenkins script, and then restarted it with "sudo service jenkins restart" and I verified that the settings were passed to the jvm. I also tried adding an environment variable in my Jenkins global configuration HTTP_PROXY set to http://myproxyhost:3128/.

     

    # ps -ef | grep jenkins
    jenkins  15663 15655 99 15:43 ?        00:00:07 /usr/bin/java -Dhttp.proxyHost=myproxyhost -Dhttp.proxyPort=3128 -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1 
    

     

    I've already confirmed that the proxy is working from the jenkins server by using wget.

     

    Is there a way to make this work?

     

    Here's the tail end of my jenkins build.

    Build result: SUCCESS
    Host: 10.74.101.15
    Port: 8080
    User: deployuser
    Application: XML Validator
    Deplement Template Category Name: Validator Deployment Templates
    Deployment Template: DEPLOY_DEB
    Project Name: ese-styx-validator
    Deplyment Plan Usage Method: Create new deployment plan everytime
    Deployment Plan Name: DeploymentPlan-${build_id}
    Deployment Plan Description: 
    Deployment Name: Deployment-${build_id}
    Deployment Description: 
    Build Name: Build-${build_id}
    Deployment Environments: Mini
    Deployment Stage To Execute: Full
    Add Package to Deployment Plan: false
    Update Step Parameters: false
    Update Template Properties: false
    Run Async: false
    Use SSL: false
    Fail if Deployment fails: false
    Run Deployment Plan only if build succeeded: true
    Result of parameterValue: deployuser - User Name: deployuser; Result of parameterValue: XML Validator - Application value: XML Validator; Result of parameterValue: Validator Deployment Templates - Template Category value: Validator Deployment Templates; Result of parameterValue: DEPLOY_DEB - Template value: DEPLOY_DEB; Result of parameterValue: ese-styx-validator - Deployment Project Name: ese-styx-validator; Result of parameterValue: DeploymentPlan-7 - Deployment Plan Name: DeploymentPlan-7; Result of parameterValue:  - Deployment Plan Description: ; Result of parameterValue: Deployment-7 - Deployment Name: Deployment-7; Result of parameterValue:  - Deployment Description: ; Result of parameterValue: Build-7 - Build Name: Build-7; Result of parameterValue: ********* - Result of parameterValue: Mini - Environment Name: Mini; Result of parameterValue: Full - Deployment stage to execute: Full; Result of parameterValue:  - Package Name: ; Result of parameterValue:  - Package Description: ; Result of parameterValue: -1 - Timeout Description: -1; Result of parameterValue:  - Artifact Type: ; Result of parameterValue:  - Artifact Definition: ; Result of parameterValue: Version-7 - Artifact Version: Version-7; Result of parameterValue:  - Artifact Version Description: ; Result of parameterValue:  - Agent Name: ; Result of parameterValue:  - HTTP Url: ; Result of parameterValue:  - HTTP Username: ; Result of parameterValue:  - HTTP File Alias: ; Result of parameterValue:  - Step Name: ; Result of parameterValue:  - Process Name: ; Result of parameterValue:  - Parameter Name: ; Result of parameterValue:  - String Value: ; Result of parameterValue:  - Property Name: ; Result of parameterValue:  - Property Value: ; 
    ***************************** Running Deployment Plan: DeploymentPlan-7 *****************************
    
    Manifest XML is 
    Running Deployment plan with parameters 10.74.101.15 8080 deployuser ****** XML Validator  artifactPackageAsXML Build-7 Deployment-7   DeploymentPlan-7  DEPLOY_DEB [Mini]  ese-styx-validator Validator Deployment Templates false -1
    Error occurred while generating the request for run-deployment-plan
    Connection to http://10.74.101.15:8080 refused
    org.apache.http.conn.HttpHostConnectException: Connection to http://10.74.101.15:8080 refused
    Finished: SUCCESS
    


  • 2.  Re: Can I use a proxy to reach RA from the Jenkins plugin?
    Best Answer

    Broadcom Employee
    Posted Oct 09, 2015 12:56 PM

    Hello Ryan,

     

    Since the connection is being refused in the plug-in, please create a rule in the firewall to open up the connection to the RA URL as defined in the RA's Jenkins plug-in.

     

    Thanks

     

    -Walter



  • 3.  Re: Can I use a proxy to reach RA from the Jenkins plugin?

    Posted Oct 10, 2015 12:16 AM

    Thanks for the reply Walter. That's a little bit different than what I asked, but you're right that it would work. For others that are following this, another thing that would work is to build an ssh tunnel from inside the firewall where jenkins can reach, to outside the firewall where the RA server is, and then point the jenkins plugin at the tunneled port.

     

    But the reason I'm asking about how to use a proxy is its something that's in my control, while the firewall is not under my control, and its more reliable than using an ssh tunnel.

     

    Back to that, are you saying there is not any way for the jenkins plugin to use the usual proxy settings for the jvm?



  • 4.  Re: Can I use a proxy to reach RA from the Jenkins plugin?

    Posted Jan 12, 2016 05:36 PM

    Hello Ryan ,

     

    I have  the same Problem what you have faced but in my case the fire wall  is open still i am getting the same error as your's .I am interesting to know did you get any work Around for this .If Yes Please Let me know how did you fix .

     

    But when i try ps -ef i could only see the below details .Do i need to set up anything in Jenkins.

    ps -ef|grep -i jenkins

    /apps/jdk1.8/bin/java -Djava.io.tmpdir=/apps/cmjenkins/tmp -jar slave.jar

     

    Any Help is greatly appreciated