Merge "Allow source-repositories to be disabled completely"

This commit is contained in:
Jenkins 2014-10-20 11:35:40 +00:00 committed by Gerrit Code Review
commit 8ba6a26e0a
3 changed files with 14 additions and 1 deletions

View File

@ -3,4 +3,8 @@
set -eu set -eu
set -o pipefail set -o pipefail
install -m 0755 -o root -g root /opt/stack/lsb-release/lsb_release /usr/local/bin if [ -z "${NO_SOURCE_REPOSITORIES:-}" ]; then
install -m 0755 -o root -g root /opt/stack/lsb-release/lsb_release /usr/local/bin
else
install-packages redhat-lsb-core
fi

View File

@ -103,3 +103,7 @@ The base url for all git repositories can be set by use of:
So setting DIB\_GITREPOBASE=https://github.com/ when the repo location is set So setting DIB\_GITREPOBASE=https://github.com/ when the repo location is set
to http://git.openstack.org/openstack/nova.git will result in use of the to http://git.openstack.org/openstack/nova.git will result in use of the
https://github.com/openstack/nova.git repository. https://github.com/openstack/nova.git repository.
When doing image builds in environments where external resources are not allowed,
it is possible to disable fetching of all source repositories by including an
element in the image that sets NO_SOURCE_REPOSITORIES=1 in an environment.d script.

View File

@ -3,6 +3,11 @@
set -eu set -eu
set -o pipefail set -o pipefail
# Don't provide any source repositories in environments where they are not allowed
if [ -n "${NO_SOURCE_REPOSITORIES:-}" ]; then
exit 0
fi
# If the old cache exists, move it to the new name # If the old cache exists, move it to the new name
function make_new_cache(){ function make_new_cache(){
local OLD_CACHE_BASE=$1 local OLD_CACHE_BASE=$1