-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
116 lines (107 loc) · 4.91 KB
/
tox.ini
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# If "pip" is not installed, install it running following command:
# $ yum install python-pip
#
# If "tox" is not installed, install it running following command:
# $ pip install -e git://github.com/tox-dev/[email protected]#egg=tox
#
# After it you can use "tox" command. For example:
# $ tox -e ocp3.11 -- pwd
[tox]
# With version 1.6.0 'skipsdist' config option was added. It allows to skip
# installation of current project to 'sdist' (no req to define setup.py file).
minversion = 1.6.0
skipsdist = True
sitepackages = False
envlist = readme
[testenv]
basepython = python2.7
envdir = {toxworkdir}/{envname}
passenv = OPENSHIFT_ANSIBLE_GIT_TAG
setenv =
OADIR={envdir}/usr/share/ansible/openshift-ansible
ANSIBLE_ROLES_PATH={env:OADIR}/roles:{toxinidir}/playbooks/roles
ANSIBLE_CALLBACK_PLUGINS={env:OADIR}/callback_plugins
ANSIBLE_FILTER_PLUGINS={env:OADIR}/filter_plugins
ANSIBLE_LOOKUP_PLUGINS={env:OADIR}/lookup_plugins
ANSIBLE_LIBRARY={toxinidir}/playbooks/library:{env:OADIR}/roles/etcd_common/library:{env:OADIR}/roles/lib_openshift/library:{env:OADIR}/roles/lib_utils/library:{env:OADIR}/roles/openshift_certificate_expiry/library:{env:OADIR}/roles/openshift_cli/library:{env:OADIR}/roles/openshift_facts/library:{env:OADIR}/roles/openshift_health_checker/library:{env:OADIR}/roles/openshift_logging/library:{env:OADIR}/roles/os_firewall/library:{env:OADIR}/library:{env:OADIR}/roles/etcd/library:{env:OADIR}/roles/lib_os_firewall/library:{env:OADIR}/roles/openshift_sanitize_inventory/library
ANSIBLE_HOST_KEY_CHECKING=False
ANSIBLE_SSH_ARGS="-C -o ControlMaster=auto -o ControlPersist=900s -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false"
whitelist_externals = *
commands =
python -m pip install --upgrade pip>=9.0.0 setuptools wheel
pip install \
cryptography \
pyyaml \
dnspython \
ipaddress \
ipaddr \
iptools \
netaddr \
pyvmomi \
click \
pyOpenSSL \
passlib \
schema \
Jinja2>=2.8
bash -ec "yum -y install git libselinux-python || echo 'WARNING! Failed to run yum command. Make sure you have enough rights. Continuing assuming that yum packages are installed.'"
mkdir -p {envdir}/lib/python2.7/site-packages
bash -ec "if [ ! -e {envdir}/lib/python2.7/site-packages/selinux ]; then \
ln -s /usr/lib64/python2.7/site-packages/selinux \
{envdir}/lib/python2.7/site-packages/selinux ; \
fi"
find . -type f -name "*.py[c|o]" -delete
{toxinidir}/scripts/install_openshift_ansible.sh \
{envdir} {env:OPENSHIFT_ANSIBLE_GIT_TAG}
[testenv:readme]
commands =
echo -e 'To create environment for installation of '\
'OpenShift (OCP) 3.11 run following command:\n\n'\
' $ tox -e ocp3.11\n\n'\
'or for version 3.10 run following command:\n\n'\
' $ tox -e ocp3.10\n\n'\
'or for version 3.9 run following command:\n\n'\
' $ tox -e ocp3.9\n\n'\
'or for version 3.7 run following command:\n\n'\
' $ tox -e ocp3.7\n\n'\
'or for version 3.6 run following:\n\n'\
' $ tox -e ocp3.6\n'
[testenv:ocp3.6]
commands =
{[testenv]commands}
{envdir}/bin/pip install ansible==2.4.3.0
bash -c "export ANSIBLE_LOG_PATH={toxinidir}/ansible_{envname}_`date +%Y_%m_%d__%H_%M_%S`.log ; {posargs:echo 'No commands have been specified. Exiting.'}"
setenv =
{[testenv]setenv}
OPENSHIFT_ANSIBLE_GIT_TAG={env:OPENSHIFT_ANSIBLE_GIT_TAG:''}
[testenv:ocp3.7]
commands =
{[testenv]commands}
{envdir}/bin/pip install ansible==2.4.3.0
bash -c "export ANSIBLE_LOG_PATH={toxinidir}/ansible_{envname}_`date +%Y_%m_%d__%H_%M_%S`.log ; {posargs:echo 'No commands have been specified. Exiting.'}"
setenv =
{[testenv]setenv}
OPENSHIFT_ANSIBLE_GIT_TAG={env:OPENSHIFT_ANSIBLE_GIT_TAG:''}
[testenv:ocp3.9]
commands =
{[testenv]commands}
{envdir}/bin/pip install ansible==2.4.3.0
bash -c "export ANSIBLE_LOG_PATH={toxinidir}/ansible_{envname}_`date +%Y_%m_%d__%H_%M_%S`.log ; {posargs:echo 'No commands have been specified. Exiting.'}"
setenv =
{[testenv]setenv}
OPENSHIFT_ANSIBLE_GIT_TAG={env:OPENSHIFT_ANSIBLE_GIT_TAG:''}
[testenv:ocp3.10]
commands =
{[testenv]commands}
{envdir}/bin/pip install ansible==2.4.6.0
bash -c "export ANSIBLE_LOG_PATH={toxinidir}/ansible_{envname}_`date +%Y_%m_%d__%H_%M_%S`.log ; {posargs:echo 'No commands have been specified. Exiting.'}"
setenv =
{[testenv]setenv}
OPENSHIFT_ANSIBLE_GIT_TAG={env:OPENSHIFT_ANSIBLE_GIT_TAG:''}
[testenv:ocp3.11]
commands =
{[testenv]commands}
{envdir}/bin/pip install ansible==2.6.2
bash -c "export ANSIBLE_LOG_PATH={toxinidir}/ansible_{envname}_`date +%Y_%m_%d__%H_%M_%S`.log ; {posargs:echo 'No commands have been specified. Exiting.'}"
setenv =
{[testenv]setenv}
OPENSHIFT_ANSIBLE_GIT_TAG={env:OPENSHIFT_ANSIBLE_GIT_TAG:''}