[tox]
minversion = 1.6
envlist = py27
skipdist = True

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt

[testenv:docs]
commands = python setup.py build_sphinx

[testenv:ansible-lint]
whitelist_externals = bash
commands =
    ansible-galaxy install -r ansible-role-requirements.yml --force
    bash -c "find . -type f ! -path '*jenkins/*' ! -path '*.tox/*' -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 ansible-lint"
setenv =
    ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
    PYTHONUNBUFFERED = 1

[testenv:ansible-playbook]
commands =
    ansible-galaxy install -r ansible-role-requirements.yml --force
    ansible-playbook {posargs}
passenv =
    HOME
    SSH_AUTH_SOCK
    USER
    CICO_API_KEY
    CICO_SSH_KEY
    JENKINS_URL
    BUILD_URL
    JOB_NAME
    BUILD_NUMBER
setenv =
    ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
    PYTHONUNBUFFERED = 1

[tox]
minversion = 1.6
envlist = py27
skipdist = True

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt

[testenv:docs]
commands = python setup.py build_sphinx

[testenv:ansible-lint]
whitelist_externals = bash
commands =
    ansible-galaxy install -r ansible-role-requirements.yml
    bash -c "find . -type f ! -path '*jenkins/*' ! -path '*.tox/*' -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 ansible-lint"
setenv =
    ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
    PYTHONUNBUFFERED = 1

[testenv:ansible-playbook]
commands =
    ansible-galaxy install -r ansible-role-requirements.yml
    ansible-playbook {posargs}
passenv =
    HOME
    SSH_AUTH_SOCK
    USER
    CICO_API_KEY
    CICO_SSH_KEY
    JENKINS_URL
    BUILD_URL
    JOB_NAME
    BUILD_NUMBER
setenv =
    ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
    PYTHONUNBUFFERED = 1

Remove --force from ansible-galaxy install
Remove --force from ansible-galaxy install

We may drop a role ourselves (i.e, from a github review commit)
so dropping --force will ensure it is not overwritten.

Change-Id: Ie7d4edff4cf33f7d7b52a61ca6a5f066948ff18e
