
When launching run_tests.sh we need to make sure to call install_modules.sh. I've moved it into the tools directory, and installed the modules local vs global. This is mostly personal preference but avoids puppet modules conflicts with global /etc/puppet folder. Change-Id: I77c445a71720e0c8dd4744777c2bc6a0a6663590 Depends-On: I87c12faffab953ad2039d2b9ed9ab420e97ab2b7 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
44 lines
1.1 KiB
Bash
Executable File
44 lines
1.1 KiB
Bash
Executable File
#!/bin/bash -ex
|
|
|
|
export SCRIPT_DIR=$(pwd)
|
|
export PUPPETFILE_DIR=${SCRIPT_DIR}/.modules
|
|
|
|
install_external() {
|
|
PUPPETFILE=${SCRIPT_DIR}/Puppetfile1 ${GEM_HOME}/bin/r10k puppetfile install -v
|
|
}
|
|
|
|
install_openstack() {
|
|
cat > clonemap.yaml <<EOF
|
|
clonemap:
|
|
- name: '(.*?)/puppet-(.*)'
|
|
dest: '$PUPPETFILE_DIR/\2'
|
|
EOF
|
|
|
|
local project_names=$(awk '{ if ($1 == ":git") print $3 }' \
|
|
${SCRIPT_DIR}/Puppetfile0 | tr -d "'," | cut -d '/' -f 4- | xargs
|
|
)
|
|
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml \
|
|
--cache-dir /opt/git \
|
|
--zuul-ref $ZUUL_REF \
|
|
--zuul-branch $ZUUL_BRANCH \
|
|
--zuul-url $ZUUL_URL \
|
|
git://git.openstack.org $project_names
|
|
}
|
|
|
|
install_all() {
|
|
PUPPETFILE=${SCRIPT_DIR}/Puppetfile ${GEM_HOME}/bin/r10k puppetfile install -v
|
|
}
|
|
|
|
# If zuul-cloner is there, have it install modules using zuul refs
|
|
if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then
|
|
csplit ${SCRIPT_DIR}/Puppetfile /'External modules'/ \
|
|
--prefix ${SCRIPT_DIR}/Puppetfile \
|
|
--suffix '%d'
|
|
install_external
|
|
install_openstack
|
|
else
|
|
install_all
|
|
fi
|
|
|
|
puppet module list --color=false
|