summaryrefslogtreecommitdiffstats
path: root/deployment/tox.ini
blob: cd44bacf67a1bf02b022847498a57b033a5c9226 (plain)
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
117
118
119
120
121
122
# 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/tox.git@2.9.1#egg=tox
#
# After it you can use "tox" command. For example:
#   $ tox -e ocp3.7 -- python ocp-on-vmware.py --create_inventory

[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={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:{envdir}/src/yedit/roles/lib_yaml_editor/library
    ANSIBLE_INVENTORY={toxinidir}/inventory/vsphere/vms/vmware_inventory.py
    ANSIBLE_SSH_ARGS="-C -o ControlMaster=auto -o ControlPersist=60s -F {homedir}/.ssh/config"
whitelist_externals = *
commands =
    touch {homedir}/.ssh/config
    python -m pip install --upgrade pip>=9.0.0 setuptools wheel
    pip install \
        cryptography \
        pyyaml \
        dnspython \
        ipaddress \
        ipaddr \
        iptools \
        netaddr \
        pyvmomi \
        click \
        pyOpenSSL \
        passlib \
        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}
    {toxinidir}/scripts/install_yedit_for_ansible.sh {envdir} master

[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 \
        -v -e "git://github.com/ansible/ansible.git@v2.4.3.0-1#egg=ansible"
    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 \
        -v -e "git://github.com/ansible/ansible.git@v2.4.3.0-1#egg=ansible"
    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 \
        -v -e "git://github.com/ansible/ansible.git@v2.4.3.0-1#egg=ansible"
    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 \
        -v -e "git://github.com/ansible/ansible.git@v2.4.6.0-1#egg=ansible"
    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 \
        -v -e "git://github.com/ansible/ansible.git@v2.6.2#egg=ansible"
    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:''}