From ed46e9303f1bf8910749e71b440e47d5b2bf3b0f Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Sat, 15 Nov 2014 18:05:39 +0000 Subject: [PATCH] Source modules.env from apply-test.sh This causes apply-test.sh to get the list of puppet modules to do integration test with from modules.env. Modules.env has been refactored to have three lists of modules: Package modules(MODULES), SOURCE_MODULES, and INTEGRATION_MODULES. When PUPPET_INTEGRATION_TEST is not set, INTEGRATION_MODULES is folded into SOURCE_MODULES. In apply-test.sh, INTEGRATION_MODULES is sourced from modules.env and some string/array manipulation is performed to pass each entry to zuul-cloner. Change-Id: I47302c5c7e8c41b985f16a05c4e9b8078ea867a3 --- install_modules.sh | 5 +++++ modules.env | 12 +++++++++--- tools/apply-test.sh | 27 +++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/install_modules.sh b/install_modules.sh index 66288095c3..e1452ff656 100755 --- a/install_modules.sh +++ b/install_modules.sh @@ -34,6 +34,11 @@ declare -A MODULES # key:value is source location, revision to checkout declare -A SOURCE_MODULES +# Array of modues to be installed from source and without dependency resolution from openstack git +# key:value is source location, revision to checkout +declare -A INTEGRATION_MODULES + + #NOTE: if we previously installed kickstandproject-ntp we nuke it here # since puppetlabs-ntp and kickstandproject-ntp install to the same dir if grep kickstandproject-ntp /etc/puppet/modules/ntp/Modulefile &> /dev/null; then diff --git a/modules.env b/modules.env index fc3a971324..3f5739243a 100644 --- a/modules.env +++ b/modules.env @@ -54,10 +54,16 @@ MODULES["puppetlabs-rabbitmq"]="4.0.0" # we do not update local branches in this script. SOURCE_MODULES["https://github.com/puppet-community/puppet-module-puppetboard"]="2.4.0" + # Add modules that should be part of the openstack-infra integration test here +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-kibana"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-jenkins"]="origin/master" + if [[ "$PUPPET_INTEGRATION_TEST" -ne "1" ]]; then - SOURCE_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master" - SOURCE_MODULES["https://git.openstack.org/openstack-infra/puppet-kibana"]="origin/master" - SOURCE_MODULES["https://git.openstack.org/openstack-infra/puppet-jenkins"]="origin/master" + # If puppet integration tests are not being run, merge SOURCE and INTEGRATION modules + for MOD in ${!INTEGRATION_MODULES[*]}; do + SOURCE_MODULES[$MOD]=${INTEGRATION_MODULES[$MOD]} + done fi diff --git a/tools/apply-test.sh b/tools/apply-test.sh index 7296a3dce1..1c14358284 100755 --- a/tools/apply-test.sh +++ b/tools/apply-test.sh @@ -27,13 +27,32 @@ clonemap: dest: '/etc/puppet/modules/\2' EOF -# Add puppet modules that should be installed to the end of this list +# These arrays are initialized here and populated in modules.env + +# Array of modules to be installed key:value is module:version. +declare -A MODULES + +# Array of modues to be installed from source and without dependency resolution. +# key:value is source location, revision to checkout +declare -A SOURCE_MODULES + +# Array of modues to be installed from source and without dependency resolution from openstack git +# key:value is source location, revision to checkout +declare -A INTEGRATION_MODULES + + +project_names="" +source modules.env +for MOD in ${!INTEGRATION_MODULES[*]}; do + project_scope=$(basename `dirname $MOD`) + repo_name=`basename $MOD` + project_names+=" $project_scope/$repo_name" +done + sudo -E /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ git://git.openstack.org \ - openstack-infra/puppet-storyboard \ openstack-infra/project-config \ - openstack-infra/puppet-jenkins \ - openstack-infra/puppet-kibana + $project_names if [[ ! -d applytest ]] ; then