forked from openshift-metal3/dev-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_install_requirements.sh
executable file
·64 lines (56 loc) · 2.1 KB
/
01_install_requirements.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -ex
source logging.sh
source common.sh
source sanitychecks.sh
source utils.sh
source ocp_install_env.sh
if [ -z "${METAL3_DEV_ENV}" ]; then
export REPO_PATH=${WORKING_DIR}
sync_repo_and_patch metal3-dev-env https://github.com/metal3-io/metal3-dev-env.git
pushd ${METAL3_DEV_ENV_PATH}
# Pin to a specific metal3-dev-env commit to ensure we catch breaking
# changes before they're used by everyone and CI.
# TODO -- come up with a plan for continuously updating this
# Note we only do this in the case where METAL3_DEV_ENV is
# unset, to enable developer testing of local checkouts
git reset d31a9c11651c4baaeb82c3db4a30b613713f3dba --hard
popd
fi
pushd ${METAL3_DEV_ENV_PATH}
./centos_install_requirements.sh
ansible-galaxy install -r vm-setup/requirements.yml
ANSIBLE_FORCE_COLOR=true ansible-playbook \
-e "working_dir=$WORKING_DIR" \
-e "virthost=$HOSTNAME" \
-e "go_version=1.14.4" \
-i vm-setup/inventory.ini \
-b -vvv vm-setup/install-package-playbook.yml
popd
# We use yq in a few places for processing YAML but it isn't packaged
# for CentOS/RHEL so we have to install from pip.
pip3 install --user 'yq>=2.10.0'
# needed if we are using locally built images
# We stop any systemd service so we can run in a container, since
# there's no RPM/systemd version available for RHEL8
if sudo systemctl is-active docker-distribution.service; then
sudo systemctl disable --now docker-distribution.service
fi
# Install oc client - unless we're in openshift CI
if [[ -z "$OPENSHIFT_CI" ]]; then
oc_tools_dir="${WORKING_DIR}/oc/${OPENSHIFT_VERSION}"
oc_tools_local_file=openshift-client-${OPENSHIFT_VERSION}.tar.gz
oc_download_url="https://mirror.openshift.com/pub/openshift-v4/clients/oc/${OPENSHIFT_VERSION}/linux/oc.tar.gz"
mkdir -p ${oc_tools_dir}
pushd ${oc_tools_dir}
if [ ! -f "${oc_tools_local_file}" ]; then
curl -L -o ${oc_tools_local_file} ${oc_download_url}
tar xvzf ${oc_tools_local_file}
fi
sudo cp oc /usr/local/bin/
oc version --client -o json
popd
fi
if [[ ! -z "${MIRROR_IMAGES}" || $(env | grep "_LOCAL_IMAGE=") ]]; then
setup_local_registry
fi