diff --git a/nodepool/elements/cache-devstack/install.d/98-build-wheelhouse b/nodepool/elements/cache-devstack/install.d/98-build-wheelhouse new file mode 100755 index 0000000000..e4269ba7da --- /dev/null +++ b/nodepool/elements/cache-devstack/install.d/98-build-wheelhouse @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright (C) 2015 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eux + + +DEVSTACK='/opt/git/openstack-dev/devstack' + +export WHEELHOUSE='/home/jenkins/cache/files/wheelhouse' + +pushd $DEVSTACK +for branch in $(git branch -a | grep '^\s*remotes/origin') ; do + if [[ $(echo $branch | grep '^->') || $(echo $branch | grep "^origin") || $(echo $branch | grep 'HEAD') ]]; then + continue + fi + sudo git checkout $branch + if [[ -f $DEVSTACK/tools/build_wheels.sh ]] ; then + bash tools/build_wheels.sh + fi +done +popd diff --git a/nodepool/scripts/cache_devstack.py b/nodepool/scripts/cache_devstack.py index 380af75d67..d3de52d30c 100755 --- a/nodepool/scripts/cache_devstack.py +++ b/nodepool/scripts/cache_devstack.py @@ -94,6 +94,15 @@ def _find_images(basedir): return images +def _build_wheelhouse(basedir): + build_wheels_path = os.path.join(basedir, 'tools/build_wheels.sh') + if os.path.isfile(build_wheels_path): + env = os.environ + # Makes output dir for wheelhouse CACHEDIR/wheelhouse + env['WHEELHOUSE'] = os.path.join(CACHEDIR, 'wheelhouse') + run_local(['bash', 'tools/build_wheels.sh'], cwd=DEVSTACK, env=env) + + def local_prep(distribution): branches = [] for branch in git_branches(): @@ -133,6 +142,7 @@ def local_prep(distribution): branch_data['images'] = images branches.append(branch_data) + _build_wheelhouse(DEVSTACK) return branches