|
|
|
@ -23,7 +23,7 @@
|
|
|
|
|
# library modules.
|
|
|
|
|
|
|
|
|
|
# This script uses system-config/modules.env as the source of truth for modules
|
|
|
|
|
# to install. It detects the presence of zuul-cloner to decide if we are running
|
|
|
|
|
# to install. It detects the presence of /home/zuul to decide if we are running
|
|
|
|
|
# in a zuul environment or not.
|
|
|
|
|
|
|
|
|
|
ROOT=$(readlink -fn $(dirname $0)/..)
|
|
|
|
@ -53,32 +53,16 @@ install_openstack() {
|
|
|
|
|
modulepath='/etc/puppetlabs/code/modules'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cat > clonemap.yaml <<EOF
|
|
|
|
|
clonemap:
|
|
|
|
|
- name: openstack/project-config
|
|
|
|
|
dest: /etc/project-config
|
|
|
|
|
- name: '(.*?)/puppet-(.*)'
|
|
|
|
|
dest: '$modulepath/\2'
|
|
|
|
|
EOF
|
|
|
|
|
sudo -E git clone /home/zuul/src/opendev.org/openstack/project-config /etc/project-config
|
|
|
|
|
|
|
|
|
|
project_names=""
|
|
|
|
|
source ${ROOT}/modules.env
|
|
|
|
|
for MOD in ${!INTEGRATION_MODULES[*]}; do
|
|
|
|
|
project_scope=$(basename `dirname $MOD`)
|
|
|
|
|
repo_name=`basename $MOD`
|
|
|
|
|
project_names+=" $project_scope/$repo_name"
|
|
|
|
|
project_scope=$(basename $(dirname $MOD))
|
|
|
|
|
repo_name=$(basename $MOD)
|
|
|
|
|
short_name=$(echo $repo_name | cut -f2- -d-)
|
|
|
|
|
sudo -E git clone /home/zuul/src/opendev.org/$project_scope/$repo_name $modulepath/$short_name
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
sudo -E /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
|
|
|
|
|
https://git.openstack.org \
|
|
|
|
|
openstack/project-config \
|
|
|
|
|
$project_names
|
|
|
|
|
|
|
|
|
|
# Zuul v3 doesn't add remotes like origin but our use of puppet vcsrepo
|
|
|
|
|
# errors if it can't update itself against origin (because vcsrepo manages
|
|
|
|
|
# repos that it will initially clone). Address this by adding an origin
|
|
|
|
|
# for the vcsrepo managed repo here.
|
|
|
|
|
sudo git -C /etc/project-config remote add origin 'https://opendev.org/openstack/project-config'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install_all() {
|
|
|
|
@ -86,7 +70,7 @@ install_all() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then
|
|
|
|
|
if [ -d /home/zuul/src/opendev.org ] ; then
|
|
|
|
|
install_external
|
|
|
|
|
install_openstack
|
|
|
|
|
else
|
|
|
|
|