forked from user-cont/conu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-requirements.sh
executable file
·32 lines (27 loc) · 1.15 KB
/
test-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
#!/bin/bash
set -e
source /etc/os-release
set -x
if [ "${NAME}" == "Fedora" ]; then
dnf install -y docker make
elif [ "${NAME}" == "CentOS Linux" ]; then
yum install -y docker make
fi
setenforce 0
systemctl stop firewalld # firewall on CentOS does not allow docker login into OpenShift registry
systemctl start docker
touch /etc/docker/daemon.json
echo '{"insecure-registries" : [ "172.30.0.0/16" ]}' > /etc/docker/daemon.json
systemctl restart docker
curl -Lo openshift.tar.gz https://github.com/openshift/origin/releases/download/v3.9.0/openshift-origin-server-v3.9.0-191fece-linux-64bit.tar.gz
tar -zxf openshift.tar.gz
mv -v openshift-origin-server-v3.9.0-191fece-linux-64bit/* /sbin/
oc cluster status || oc cluster up --version v3.9.0
oc login -u system:admin
oc adm policy add-role-to-user system:registry developer
oc adm policy add-role-to-user admin developer -n openshift
oc adm policy add-role-to-user system:image-builder developer
oc adm policy add-cluster-role-to-user cluster-reader developer
oc adm policy add-cluster-role-to-user admin developer
oc adm policy add-cluster-role-to-user cluster-admin developer
oc login -u developer -p developer