77b1b24911
This is an alternative to tox. Change-Id: I394774836e303584473f0e7d64d496baa393037a
35 lines
946 B
YAML
35 lines
946 B
YAML
- name: Install pip
|
|
include_role:
|
|
name: ensure-pip
|
|
|
|
- name: Check if nox is installed
|
|
shell: |
|
|
command -v {{ nox_executable }} {{ nox_venv_path }}/bin/nox || exit 1
|
|
args:
|
|
executable: /bin/bash
|
|
register: nox_preinstalled
|
|
failed_when: false
|
|
|
|
- name: Export preinstalled nox_exectuable
|
|
set_fact:
|
|
nox_executable: '{{ nox_preinstalled.stdout_lines[0] }}'
|
|
cacheable: true
|
|
when: nox_preinstalled.rc == 0
|
|
|
|
- name: Install nox to local env
|
|
when: nox_preinstalled.rc != 0
|
|
block:
|
|
- name: Create local venv
|
|
command: '{{ ensure_pip_virtualenv_command }} {{ nox_venv_path }}'
|
|
|
|
- name: Install nox to local venv
|
|
command: '{{ nox_venv_path }}/bin/pip install nox{{ ensure_nox_version }}'
|
|
|
|
- name: Export installed nox_executable path
|
|
set_fact:
|
|
nox_executable: '{{ nox_venv_path }}/bin/nox'
|
|
cacheable: true
|
|
|
|
- name: Output nox version
|
|
command: "{{ nox_executable }} --version"
|