Merge "Remove r10k env vars with proper args"

This commit is contained in:
Zuul 2018-02-05 21:40:03 +00:00 committed by Gerrit Code Review
commit b3bdcfa99d
3 changed files with 12 additions and 10 deletions

View File

@ -8,21 +8,22 @@
#
# - ``SCRIPT_DIR`` must be set to script path
# - ``GEM_BIN_DIR`` must be set to Gem bin directory
# - ``MODULES_DIR`` must be set to Puppet modules directory
install_external() {
PUPPETFILE=${SCRIPT_DIR}/Puppetfile1 r10k -v DEBUG puppetfile install
r10k -v DEBUG puppetfile install --puppetfile ${SCRIPT_DIR}/Puppetfile1 --moduledir ${MODULES_DIR}
}
# Install Puppet OpenStack modules with zuul-cloner
# Uses the following variables:
#
# - ``PUPPETFILE_DIR`` must be set to Puppet modules directory
# - ``MODULES_DIR`` must be set to Puppet modules directory
# - ``SCRIPT_DIR`` must be set to script path
# - ``ZUUL_BRANCH`` must be set to Zuul branch. Fallback to 'master'.
install_openstack() {
cat > clonemap.yaml <<EOF
clonemap:
- name: '(.*?)/puppet-(.*)'
dest: '$PUPPETFILE_DIR/\2'
dest: '$MODULES_DIR/\2'
EOF
# Periodic jobs run without ref on master
@ -39,25 +40,26 @@ EOF
# Because openstack-integration can't be a class name.
# https://projects.puppetlabs.com/issues/5268
mv $PUPPETFILE_DIR/openstack-integration $PUPPETFILE_DIR/openstack_integration
mv $MODULES_DIR/openstack-integration $MODULES_DIR/openstack_integration
}
# Install all Puppet modules with r10k
# Uses the following variables:
#
# - ``SCRIPT_DIR`` must be set to script path
# - ``MODULES_DIR`` must be set to Puppet modules directory
install_all() {
# When installing from local source, we want to install the current source
# we're working from.
PUPPETFILE=${SCRIPT_DIR}/Puppetfile r10k -v DEBUG puppetfile install
cp -a ${SCRIPT_DIR} ${PUPPETFILE_DIR}/openstack_integration
r10k -v DEBUG puppetfile install --puppetfile ${SCRIPT_DIR}/Puppetfile --moduledir ${MODULES_DIR}
cp -a ${SCRIPT_DIR} ${MODULES_DIR}/openstack_integration
}
# Install Puppet OpenStack modules and dependencies by using
# zuul-cloner or r10k.
# Uses the following variables:
#
# - ``PUPPETFILE_DIR`` must be set to Puppet modules directory
# - ``MODULES_DIR`` must be set to Puppet modules directory
# - ``SCRIPT_DIR`` must be set to script path
# - ``ZUUL_BRANCH`` must be set to Zuul branch
install_modules() {

View File

@ -18,7 +18,7 @@ if [ -e /opt/puppetlabs/bin/puppet ]; then
fi
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules}
export MODULES_DIR=${MODULES_DIR:-${PUPPET_BASE_PATH}/modules}
source $SCRIPT_DIR/functions
print_header 'Start (install_modules.sh)'
@ -31,7 +31,7 @@ gem install puppet_forge -v '= 2.2.6' --verbose
gem install r10k --no-ri --no-rdoc --verbose
# make sure there is no puppet module pre-installed
rm -rf "${PUPPETFILE_DIR:?}/"*
rm -rf "${MODULES_DIR:?}/"*
print_header 'Install Modules'
install_modules

View File

@ -18,7 +18,7 @@ else
fi
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules}
export MODULES_DIR=${MODULES_DIR:-${PUPPET_BASE_PATH}/modules}
source $SCRIPT_DIR/functions
print_header 'Start (install_modules_unit.sh)'