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

Ability to select images based on OS_FAMILY and select lastest version

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins with GCE plugin

      I have a jenkins job that uses packer to generate my GCE images on demand, so that we can maintain our build and dev environments in version control. When building this way, we can set an "image_family" parameter to a custom string, and name the image with version string.

       

      It would be great if, in the configuration there was an option to select the image via 'OS Family', and always use the latest version. This way, we don't have to constantly adjust the image used, and it can be picked up dynamically. 

       

      EDIT
      After a bit of research I found that what you would want to use is  compute.Images.GetFromFamily. I do not know java very well, and I wouldn't know where to begin or I would do this myself. But I think if you just copy the current "image name" and add "os family" parameter to the form, and make it so one of them is required, or use radio boxes to select between them, then take the input from os family, save it in the settings db.

      Then when an instance is created, check if this setting is in the DB or not, and if it is, then call the compute.Images.GetFromFamily on it, and pass it to the create instance function. it could work automatically, as the documentation says it will already return the latest.

      Here is the documentation:
      https://developers.google.com/resources/api-libraries/documentation/compute/v1/java/latest/com/google/api/services/compute/Compute.Images.GetFromFamily.html

      Thanks! 

            zombiemoose Rachel Yen
            digitalirony Eric Blackwell
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: