e60dc2a3c1
If someone is building an image locally and don't want to do anything special with nodepool scripts, they should not need to set an env var. The env var obviously still needs to be honored for nodepool operation and for override. Change-Id: I08076a8eafe7019e715b1b46633e8f603031a1ea
40 lines
1.4 KiB
Bash
Executable File
40 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright (c) 2014 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.
|
|
|
|
# Copy the nodepools scripts into the image
|
|
|
|
# This is 99 because it needs to depend on source-repositories having been
|
|
# run, because the default fallthrough location for the nodepool scripts
|
|
# is the git repo that's been cloned into the image.
|
|
|
|
# During a nodepool run, it's expected that NODEPOOL_SCRIPTDIR is set, in
|
|
# which case ordering doesn't matter - but for a developer hacking locally
|
|
# who is not hacking on those scripts, it's an imposition to make them
|
|
# set an env var.
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
NODEPOOL_SCRIPTDIR=${NODEPOOL_SCRIPTDIR:-$TMP_MOUNT_PATH/opt/git/openstack-infra/project-config/nodepool/scripts}
|
|
|
|
sudo cp -a $NODEPOOL_SCRIPTDIR $TMP_MOUNT_PATH/opt/nodepool-scripts
|
|
sudo chmod -R a+rx $TMP_MOUNT_PATH/opt/nodepool-scripts
|