From: Thanh Ha Date: Sat, 21 Jan 2017 19:22:17 +0000 (-0500) Subject: Add job to generate an image list for docs X-Git-Tag: release/boron-sr3~322^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=10f924267361b2daaf3fdc2fcdd5bb4507497832;p=releng%2Fbuilder.git Add job to generate an image list for docs With Heat now available we need a way to automate the list of available images projects can use in their jobs in the docs. This creates a job that will pull from openstack a list of available public images and pushes a patch automatically to Gerrit to update the relevant documentation page. The script will automatically detect if an unmerged image update patch already exists and update existing patch if available otherwise create a new one. Change-Id: If5ea2c53b21b06ab1ed5d6c9c17f30356a930dc4 Signed-off-by: Thanh Ha --- diff --git a/jjb/opendaylight-infra-update-image-list.sh b/jjb/opendaylight-infra-update-image-list.sh new file mode 100644 index 000000000..7c7e3c93e --- /dev/null +++ b/jjb/opendaylight-infra-update-image-list.sh @@ -0,0 +1,20 @@ +#!/bin/bash +virtualenv $WORKSPACE/.venv +source $WORKSPACE/.venv/bin/activate +pip install --upgrade --quiet pip +pip install --upgrade --quiet python-openstackclient python-heatclient +pip freeze + +cat > $WORKSPACE/docs/cloud-images.rst << EOF +Following are the list of published images available to be used with Jenkins jobs. + +EOF +# Blank line before EOF is on purpose to ensure there is spacing. + +IFS=$'\n' +IMAGES=(`openstack --os-cloud odlpriv image list --public -f value -c Name`) +for i in ${IMAGES[@]}; do + echo "* $i" >> $WORKSPACE/docs/cloud-images.rst +done + +git add docs/cloud-images.rst diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml index aad8b08f5..bc556cf82 100644 --- a/jjb/releng-jobs.yaml +++ b/jjb/releng-jobs.yaml @@ -8,8 +8,11 @@ - 'builder-check-poms' - 'builder-verify-packer' - 'builder-merge-packer-{platforms}-{templates}' + # OpenStack Related - 'builder-delete-stale-stacks' + # Automation for docs and jobs - 'builder-update-csit-tests' + - 'builder-update-image-list' platforms: - centos @@ -322,6 +325,53 @@ - opendaylight-infra-shiplogs: maven-version: 'mvn33' +- job-template: + name: 'builder-update-image-list' + project-type: freestyle + node: centos7-java-builder-2c-4g + + properties: + - opendaylight-infra-properties: + build-days-to-keep: 7 + + parameters: + - opendaylight-infra-parameters: + project: '{project}' + branch: '{branch}' + refspec: 'refs/heads/{branch}' + artifacts: '{archive-artifacts}' + + scm: + - git-scm: + branch: '{branch}' + + wrappers: + - opendaylight-infra-wrappers: + build-timeout: '{build-timeout}' + # Listed after to override openstack-infra-wrappers clouds.yaml definition + - config-file-provider: + files: + - file-id: opendaylight-private-clouds-yaml + target: '$HOME/.config/openstack/clouds.yaml' + + triggers: + # Update image list every Monday to Friday at 11:00 UTC + - timed: '0 11 * * 1-5' + + builders: + - shell: !include-raw-escape: opendaylight-infra-update-image-list.sh + - opendaylight-infra-push-gerrit-patch: + project: '{project}' + gerrit-topic: 'releng-update-cloud-image-list' + gerrit-commit-message: 'Update cloud image list docs' + + publishers: + - email-notification: + email-recipients: '{email-recipients}' + email-prefix: '[releng]' + - opendaylight-infra-shiplogs: + maven-version: 'mvn33' + - job-template: name: 'builder-verify-packer' project-type: freestyle