Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34944

OPENSTACK_PUBLIC_IP environment variable not available for Execute Shell build step

    XMLWordPrintable

Details

    Description

      I am looking to launch a new slave on the run from a Jenkins job using an OpenStack template. I intend to use the OPENSTACK_PUBLIC_IP for my cloud template in the build step to get an SSH connection to it. However, if I try "echo ${OPENSTACK_PUBLIC_IP}" in Execute Shell build step, there is no IP value printed in the build logs.

      [EnvInject] - Loading node environment variables.
      Building on master in workspace /var/jenkins_home/workspace/Test creator build vm
      Queuing cloud instance: #0 1, openstack.hh.flowcloud.systems creator-build-slave
      [Test creator build vm] $ /bin/sh -xe /tmp/hudson1077495689853449831.sh
      + echo

      Destroying nodes: [NovaServer{id=b3f7aa60-ae50-4f43-a91e-3180fe0a978c, name=creator-build-slave-363, image={id=596207e4-36bf-4011-a9a3-6fdd0f51ae9c, links=[

      {href=http://10.100.127.20:8774/bb6fadb79c124ec5a6c379086fb6e7e2/images/596207e4-36bf-4011-a9a3-6fdd0f51ae9c, rel=bookmark}

      ]}, flavor=NovaFlavor{id=5, ephemeral=0, swap=0, rxtx_factor=1.0, is_public=true, links=[GenericLink

      {href=http://10.100.127.20:8774/bb6fadb79c124ec5a6c379086fb6e7e2/flavors/5, rel=bookmark}

      ],
      }, status=ACTIVE, diskconfig=MANUAL, userId=27ad4df9aa9b4273b6f18925f86612a4, created=Thu May 19 07:33:00 UTC 2016, updated=Thu May 19 07:33:12 UTC 2016, launched at=Thu May 19 07:33:12 UTC 2016, tenantId=bb6fadb79c124ec5a6c379086fb6e7e2, hostId=46de3a3cf822b08f85a0b19b44ccc0e38a23cf4addc41b8cbc1b665a, addresses=NovaAddresses{addresses={Internal-QA-NET=[NovaAddress

      {address=172.16.0.169, type=fixed, version=4, macaddr=fa:16:3e:47:d8:af, }]}

      ,
      }, powerstate=1, vmState=active, metadata={jenkins-template-name=creator-build-slave, jenkins-instance=http://10.100.124.153:8080/}}]
      Finished: SUCCESS

      Attachments

        Activity

          olivergondza Oliver Gondža added a comment - - edited

          OPENSTACK_PUBLIC_IP is a variable available on the Jenkins node created by this plugin to point back to the host itself. You do not see it on your slave because your build is not run on a node created by the plugin. The OpenStack Instance Creation feature you seem to be using exposes ips in JCLOUDS_IPS variable for the build.

          Please reopen in case you find this insufficiently documented on wiki/jenkins help.

          olivergondza Oliver Gondža added a comment - - edited OPENSTACK_PUBLIC_IP is a variable available on the Jenkins node created by this plugin to point back to the host itself. You do not see it on your slave because your build is not run on a node created by the plugin. The OpenStack Instance Creation feature you seem to be using exposes ips in JCLOUDS_IPS variable for the build. Please reopen in case you find this insufficiently documented on wiki/jenkins help.

          Thanks olivergondza, that clarifies. Yes, it would really help to point out in the wiki/jenkins help page how the OpenStack Instance Creation works in an identical manner as to the JClouds Instance Creation feature.

          nikhil_zinjurde Nikhil Zinjurde added a comment - Thanks olivergondza , that clarifies. Yes, it would really help to point out in the wiki/jenkins help page how the OpenStack Instance Creation works in an identical manner as to the JClouds Instance Creation feature.

          People

            olivergondza Oliver Gondža
            nikhil_zinjurde Nikhil Zinjurde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: