forked from openshift/assisted-test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_full_environment.sh
executable file
·43 lines (34 loc) · 1.07 KB
/
create_full_environment.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
#!/usr/bin/env bash
set -o errexit
function error() {
echo $@ 1>&2
}
# Check OS
OS=$(awk -F= '/^ID=/ { print $2 }' /etc/os-release | tr -d '"')
if [[ ! ${OS} =~ ^(centos)$ ]] && [[ ! ${OS} =~ ^(rhel)$ ]] && [[ ! ${OS} =~ ^(fedora)$ ]]; then
error "\"${OS}\" is an unsupported OS. We support only CentOS, RHEL or FEDORA."
exit 1
fi
#Check CentOS version
VER=$(awk -F= '/^VERSION_ID=/ { print $2 }' /etc/os-release | tr -d '"' | cut -f1 -d'.')
VER_SUPPORTED=8
if [[ ${OS} =~ ^(centos)$ && ${VER} -ne ${VER_SUPPORTED} ]]; then
error "CentOS version ${VER_SUPPORTED} is required."
exit 1
elif [[ ${OS} =~ ^(rhel)$ && ${VER} -ne ${VER_SUPPORTED} ]]; then
error "RHEL version ${VER_SUPPORTED} is required."
exit 1
fi
# TODO add minimum version fedora validation
echo "Installing environment"
scripts/install_environment.sh
echo "Done installing"
echo "Creating image"
make image_build
echo "Done creating image"
echo "Installing minikube and oc"
make install_minikube
if [ -z "${NO_MINIKUBE}" ]; then
echo "Install and start minikube"
make start_minikube
fi