Skip to content

Commit 01ad56a

Browse files
author
OpenShift Bot
authored
Merge pull request #8853 from stevekuznetsov/skuznets/bash-preamble-ii
Merged by openshift-bot
2 parents b095e3a + 4a12962 commit 01ad56a

File tree

91 files changed

+326
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+326
-290
lines changed

Diff for: contrib/vagrant/provision-config.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ set -o pipefail
77
# Set a useful format for xtrace output
88
# export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
99

10-
ORIGIN_ROOT=$(
10+
OS_ROOT=$(
1111
unset CDPATH
1212
origin_root=$(dirname "${BASH_SOURCE}")/../..
1313
cd "${origin_root}"
1414
pwd
1515
)
16-
source ${ORIGIN_ROOT}/hack/common.sh
17-
source ${ORIGIN_ROOT}/contrib/vagrant/provision-util.sh
16+
source "${OS_ROOT}/hack/lib/init.sh"
17+
source ${OS_ROOT}/contrib/vagrant/provision-util.sh
1818

1919
# Passed as arguments to provisioning script
2020
MASTER_IP=${1:-""}
@@ -26,7 +26,7 @@ INSTANCE_PREFIX=${4:-${OPENSHIFT_INSTANCE_PREFIX:-openshift}}
2626
FIXUP_NET_UDEV=false
2727
NETWORK_PLUGIN=${OPENSHIFT_NETWORK_PLUGIN:-""}
2828
NODE_INDEX=0
29-
CONFIG_ROOT=${ORIGIN_ROOT}
29+
CONFIG_ROOT=${OS_ROOT}
3030
SKIP_BUILD=${OPENSHIFT_SKIP_BUILD:-false}
3131

3232
# Parse optional arguments

Diff for: contrib/vagrant/provision-dind.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -euo
33

4-
ORIGIN_ROOT=$(
4+
OS_ROOT=$(
55
unset CDPATH
66
origin_root=$(dirname "${BASH_SOURCE}")/../..
77
cd "${origin_root}"
@@ -28,21 +28,21 @@ systemctl start docker
2828
setenforce 0 || true
2929

3030
# Add a convenience symlink to the gopath repo
31-
ln -sf "${ORIGIN_ROOT}" /
31+
ln -sf "${OS_ROOT}" /
3232

3333
function set_env {
3434
USER_DIR="${1}"
3535
# Prefer bashrc to bash_profile since bash_profile is only loaded on
3636
# login and bashrc is loaded by bash_profile anyway.
3737
TARGET="${USER_DIR}/.bashrc"
38-
OUTPUT_PATH="${ORIGIN_ROOT}/_output/local"
38+
OUTPUT_PATH="${OS_ROOT}/_output/local"
3939
if [[ -z "$(grep ${OUTPUT_PATH} ${TARGET})" ]]; then
4040
echo "export GOPATH=${OUTPUT_PATH}/go" >> ${TARGET}
4141
# Binpath for origin binaries
4242
echo "export PATH=${OUTPUT_PATH}/bin/linux/amd64:\$PATH" >> ${TARGET}
4343
# Binpath for go-getted binaries
4444
echo "export PATH=${OUTPUT_PATH}/go/bin:\$PATH" >> ${TARGET}
45-
echo "cd ${ORIGIN_ROOT}" >> ${TARGET}
45+
echo "cd ${OS_ROOT}" >> ${TARGET}
4646
else
4747
echo "path variables for ${USER_DIR} already configured"
4848
fi

Diff for: contrib/vagrant/provision-master.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
source $(dirname $0)/provision-config.sh
44

5-
os::provision::base-provision "${ORIGIN_ROOT}" true
5+
os::provision::base-provision "${OS_ROOT}" true
66

7-
os::provision::build-origin "${ORIGIN_ROOT}" "${SKIP_BUILD}"
8-
os::provision::build-etcd "${ORIGIN_ROOT}" "${SKIP_BUILD}"
7+
os::provision::build-origin "${OS_ROOT}" "${SKIP_BUILD}"
8+
os::provision::build-etcd "${OS_ROOT}" "${SKIP_BUILD}"
99

10-
os::provision::base-install "${ORIGIN_ROOT}" "${CONFIG_ROOT}"
10+
os::provision::base-install "${OS_ROOT}" "${CONFIG_ROOT}"
1111

1212
if [[ "${SDN_NODE}" = "true" ]]; then
1313
# Running an sdn node on the master when using an openshift sdn
@@ -56,7 +56,7 @@ if [[ "${SDN_NODE}" = "true" ]]; then
5656
# as possible for the node to register itself. Vagrant can deploy
5757
# in parallel but dind deploys serially for simplicity.
5858
if ! os::provision::in-container; then
59-
os::provision::disable-node "${ORIGIN_ROOT}" "${DEPLOYED_CONFIG_ROOT}" \
59+
os::provision::disable-node "${OS_ROOT}" "${DEPLOYED_CONFIG_ROOT}" \
6060
"${SDN_NODE_NAME}"
6161
fi
6262
fi

Diff for: contrib/vagrant/provision-node.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source $(dirname $0)/provision-config.sh
55
# Provided index is 1-based, array is 0 based
66
NODE_NAME=${NODE_NAMES[${NODE_INDEX}-1]}
77

8-
os::provision::base-provision "${ORIGIN_ROOT}"
8+
os::provision::base-provision "${OS_ROOT}"
99

1010
# Waiting for node config to exist before deploying allows vm
1111
# provisioning to safely execute in parallel.
@@ -21,7 +21,7 @@ os::provision::copy-config "${CONFIG_ROOT}"
2121

2222
# Binaries are expected to have been built by the time node
2323
# configuration is available.
24-
os::provision::base-install "${ORIGIN_ROOT}" "${DEPLOYED_CONFIG_ROOT}"
24+
os::provision::base-install "${OS_ROOT}" "${DEPLOYED_CONFIG_ROOT}"
2525

2626
echo "Launching openshift daemon"
2727
os::provision::start-node-service "${DEPLOYED_CONFIG_ROOT}" "${NODE_NAME}"

Diff for: contrib/vagrant/provision-util.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
source "${ORIGIN_ROOT}/contrib/node/install-sdn.sh"
2+
source "${OS_ROOT}/contrib/node/install-sdn.sh"
33

44
os::provision::join() {
55
local IFS="$1"

Diff for: examples/data-population/templates.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ echo "Populating templates"
1111

1212
export KUBECONFIG=${OPENSHIFT_ADMIN_CONFIG}
1313

14-
ORIGIN_ROOT=$(dirname "${BASH_SOURCE}")/../..
15-
EXAMPLES_ROOT=${ORIGIN_ROOT}/examples
14+
OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
15+
EXAMPLES_ROOT=${OS_ROOT}/examples
1616

1717
TEMPLATES="$EXAMPLES_ROOT/db-templates
1818
$EXAMPLES_ROOT/sample-app/application-template-*

Diff for: hack/build-base-images.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ set -o pipefail
1111

1212
STARTTIME=$(date +%s)
1313
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14-
source "${OS_ROOT}/hack/common.sh"
15-
source "${OS_ROOT}/hack/util.sh"
14+
source "${OS_ROOT}/hack/lib/init.sh"
1615
os::log::install_errexit
1716

1817
# Go to the top of the tree.

Diff for: hack/build-cross.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ set -o pipefail
88

99
STARTTIME=$(date +%s)
1010
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11-
source "${OS_ROOT}/hack/common.sh"
12-
source "${OS_ROOT}/hack/util.sh"
11+
source "${OS_ROOT}/hack/lib/init.sh"
1312
os::log::install_errexit
1413

1514
platforms=( "${OS_CROSS_COMPILE_PLATFORMS[@]}" )

Diff for: hack/build-go.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ set -o pipefail
88

99
STARTTIME=$(date +%s)
1010
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
11-
source "${OS_ROOT}/hack/common.sh"
12-
source "${OS_ROOT}/hack/util.sh"
11+
source "${OS_ROOT}/hack/lib/init.sh"
1312
os::log::install_errexit
1413

1514
# only works on Linux for now, all other platforms must build binaries themselves

Diff for: hack/build-images.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ set -o pipefail
1313

1414
STARTTIME=$(date +%s)
1515
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
16-
source "${OS_ROOT}/hack/common.sh"
17-
source "${OS_ROOT}/hack/util.sh"
16+
source "${OS_ROOT}/hack/lib/init.sh"
1817
source "${OS_ROOT}/contrib/node/install-sdn.sh"
1918
os::log::install_errexit
2019

Diff for: hack/build-in-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function absolute_path() {
1515

1616
STARTTIME=$(date +%s)
1717
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
18-
source "${OS_ROOT}/hack/text.sh"
18+
source "${OS_ROOT}/hack/lib/init.sh"
1919
origin_path="src/github.com/openshift/origin"
2020

2121
# TODO: Remove this check and fix the docker command instead after the

Diff for: hack/build-release.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ set -o pipefail
1111

1212
STARTTIME=$(date +%s)
1313
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
14-
source "${OS_ROOT}/hack/common.sh"
15-
source "${OS_ROOT}/hack/util.sh"
14+
source "${OS_ROOT}/hack/lib/init.sh"
1615
os::log::install_errexit
1716

1817
# Go to the top of the tree.

Diff for: hack/cherry-pick.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ set -o nounset
77
set -o pipefail
88

99
OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10-
source "${OS_ROOT}/hack/common.sh"
11-
source "${OS_ROOT}/hack/util.sh"
10+
source "${OS_ROOT}/hack/lib/init.sh"
1211
os::log::install_errexit
1312

1413
# Go to the top of the tree.

0 commit comments

Comments
 (0)