Skip to content

Commit

Permalink
UPSTREAM: <carry>: (squash) Stop installing recent bash and protoc fr…
Browse files Browse the repository at this point in the history
…om source

Remove installation from source of recent bash and protoc 3.0.0 now
that both are available on the ci build root image.

Squash with UPSTREAM: <carry>: Enable build, test and verify
  • Loading branch information
marun committed Sep 17, 2020
1 parent b451489 commit 583e078
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 86 deletions.
58 changes: 0 additions & 58 deletions openshift-hack/lib/deps.sh
@@ -1,63 +1,5 @@
#!/usr/bin/env bash

# os::deps::path_with_recent_bash returns a path that includes a
# recent bash (~ 5.x).
#
# Globals:
# None
# Arguments:
# None
# Returns:
# A path that includes a recent bash.
function os::deps::path_with_recent_bash() {
local path_with_bash="${PATH}"
local bash_version
bash_version="$( bash --version | head -n 1 | awk '{print $4}' )"
if [[ ! "${bash_version}" =~ 5.* ]]; then
recent_bash_path="${TMPDIR:-/tmp}/recent-bash"
mkdir -p "${recent_bash_path}"
if [[ ! -f "${recent_bash_path}/bash" ]]; then
pushd "${recent_bash_path}" > /dev/null || exit 1
curl -LO https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz
tar xf bash-5.0.tar.gz
pushd bash-5.0 > /dev/null || exit 1
./configure > configure.log
make > make.log
cp bash ../
popd > /dev/null || exit 1
popd > /dev/null || exit 1
fi
path_with_bash="${recent_bash_path}:${path_with_bash}"
fi
echo "${path_with_bash}"
}
readonly -f os::deps::path_with_recent_bash

# os::deps::protoc returns a path that includes protoc.
#
# Globals:
# None
# Arguments:
# None
# Returns:
# The path that includes protoc.
function os::deps::path_with_protoc() {
local path="${PATH}"
if ! which protoc &> /dev/null; then
local protoc_path="${TMPDIR:-/tmp}/protoc"
mkdir -p "${protoc_path}"
if [[ ! -f "${protoc_path}/bin/protoc" ]]; then
pushd "${protoc_path}" > /dev/null || exit 1
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
unzip protoc-3.12.3-linux-x86_64.zip
popd > /dev/null || exit 1
fi
path="${PATH}:${protoc_path}/bin"
fi
echo "${path}"
}
readonly -f os::deps::path_with_protoc

# os::deps::path_with_shellcheck returns a path that includes shellcheck.
#
# Globals:
Expand Down
8 changes: 0 additions & 8 deletions openshift-hack/test-go.sh
Expand Up @@ -3,14 +3,6 @@
# shellcheck source=openshift-hack/lib/init.sh
source "$(dirname "${BASH_SOURCE[0]}")/lib/init.sh"

# Upstream testing requires recent bash (>= 4.3). If the system bash
# is not recent (e.g openshift ci and macos), download and compile a
# newer bash and make it available in the path.
PATH="$( os::deps::path_with_recent_bash )"
export PATH

/usr/bin/env bash --version

ARTIFACTS="${ARTIFACTS:-/tmp/artifacts}"
mkdir -p "${ARTIFACTS}"

Expand Down
7 changes: 0 additions & 7 deletions openshift-hack/test-integration.sh
Expand Up @@ -3,13 +3,6 @@
# shellcheck source=openshift-hack/lib/init.sh
source "$(dirname "${BASH_SOURCE[0]}")/lib/init.sh"

# Upstream testing requires recent bash (>= 4.3). If the system bash
# is not recent (e.g openshift ci and macos), download and compile a
# newer bash and make it available in the path.
PATH="$( os::deps::path_with_recent_bash )"

/usr/bin/env bash --version

./hack/install-etcd.sh
PATH="${OS_ROOT}/third_party/etcd:${PATH}"

Expand Down
13 changes: 0 additions & 13 deletions openshift-hack/verify.sh
Expand Up @@ -3,19 +3,6 @@
# shellcheck source=openshift-hack/lib/init.sh
source "$(dirname "${BASH_SOURCE[0]}")/lib/init.sh"

# Upstream verify requires recent bash (>= 4.3). If the system bash is
# not recent (e.g openshift ci and macos), download and compile a
# newer bash and make it available in the path.
PATH="$( os::deps::path_with_recent_bash )"

/usr/bin/env bash --version

# Upstream verify requires protoc (>= 3.0.0). If not present, download
# a recent version and make it available in the path.
PATH="$( os::deps::path_with_protoc )"

/usr/bin/env protoc --version

# Required for openapi verification
PATH="$(pwd)/third_party/etcd:${PATH}"

Expand Down

0 comments on commit 583e078

Please sign in to comment.