commit
94e02e1157
@ -1,105 +0,0 @@
|
||||
# Each step entry runs a task (Azure Pipelines analog of an Ansible module).
|
||||
# https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/?view=azure-pipelines&viewFallbackFrom=azure-devops#tool
|
||||
|
||||
# `{script: ...}` is shorthand for `{task: CmdLine@<mumble>, inputs: {script: ...}}`.
|
||||
# The shell is bash.
|
||||
# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-script?view=azure-pipelines
|
||||
# https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/cmd-line-v2?view=azure-pipelines
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
displayName: Install python
|
||||
inputs:
|
||||
githubToken: '$(GITHUB_PYVER_TOKEN)'
|
||||
versionSpec: '$(python.version)'
|
||||
condition: ne(variables['python.version'], '')
|
||||
|
||||
- script: |
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws
|
||||
displayName: Authenticate to container registry
|
||||
condition: eq(variables['Agent.OS'], 'Linux')
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
|
||||
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
|
||||
AWS_DEFAULT_REGION: $(AWS_DEFAULT_REGION)
|
||||
|
||||
- script: |
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python2-dev python3-pip virtualenv
|
||||
displayName: Install build deps
|
||||
condition: and(eq(variables['python.version'], ''), eq(variables['Agent.OS'], 'Linux'))
|
||||
|
||||
- script: |
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# macOS builders lack a realpath command
|
||||
type python && python -c"import os.path;print(os.path.realpath('$(type -p python)'))" && python --version
|
||||
type python2 && python2 -c"import os.path;print(os.path.realpath('$(type -p python2)'))" && python2 --version
|
||||
type python3 && python3 -c"import os.path;print(os.path.realpath('$(type -p python3)'))" && python3 --version
|
||||
echo
|
||||
|
||||
if [ -e /usr/bin/python ]; then
|
||||
echo "/usr/bin/python: sys.executable: $(/usr/bin/python -c 'import sys; print(sys.executable)')"
|
||||
fi
|
||||
|
||||
if [ -e /usr/bin/python2 ]; then
|
||||
echo "/usr/bin/python2: sys.executable: $(/usr/bin/python2 -c 'import sys; print(sys.executable)')"
|
||||
fi
|
||||
|
||||
if [ -e /usr/bin/python2.7 ]; then
|
||||
echo "/usr/bin/python2.7: sys.executable: $(/usr/bin/python2.7 -c 'import sys; print(sys.executable)')"
|
||||
fi
|
||||
displayName: Show python versions
|
||||
|
||||
- script: |
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "$(tox.env)"))')
|
||||
|
||||
if [[ -z $PYTHON ]]; then
|
||||
echo 1>&2 "Python interpreter could not be determined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $PYTHON == "python2.7" && $(uname) == "Darwin" ]]; then
|
||||
"$PYTHON" -m ensurepip --user --altinstall --no-default-pip
|
||||
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||
elif [[ $PYTHON == "python2.7" ]]; then
|
||||
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" --output "get-pip.py"
|
||||
"$PYTHON" get-pip.py --user --no-python-version-warning
|
||||
# Avoid Python 2.x pip masking system pip
|
||||
rm -f ~/.local/bin/{easy_install,pip,wheel}
|
||||
"$PYTHON" -m pip install --user -r "tests/requirements-tox.txt"
|
||||
else
|
||||
"$PYTHON" -m pip install -r "tests/requirements-tox.txt"
|
||||
fi
|
||||
displayName: Install tooling
|
||||
|
||||
- script: |
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Tox environment name (e.g. py312-mode_mitogen) -> Python executable name (e.g. python3.12)
|
||||
PYTHON=$(python -c 'import re; print(re.sub(r"^py([23])([0-9]{1,2}).*", r"python\1.\2", "$(tox.env)"))')
|
||||
|
||||
if [[ -z $PYTHON ]]; then
|
||||
echo 1>&2 "Python interpreter could not be determined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$PYTHON" -m tox -e "$(tox.env)"
|
||||
displayName: "Run tests"
|
@ -1,157 +0,0 @@
|
||||
# Python package
|
||||
# Create and test a Python package on multiple Python versions.
|
||||
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
|
||||
|
||||
# User defined variables are also injected as environment variables
|
||||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables#environment-variables
|
||||
#variables:
|
||||
#ANSIBLE_VERBOSITY: 3
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- "*"
|
||||
exclude:
|
||||
- docs-master
|
||||
|
||||
jobs:
|
||||
- job: mac12
|
||||
# vanilla Ansible is really slow
|
||||
timeoutInMinutes: 120
|
||||
steps:
|
||||
- template: azure-pipelines-steps.yml
|
||||
pool:
|
||||
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
|
||||
vmImage: macOS-12
|
||||
strategy:
|
||||
matrix:
|
||||
Mito_312:
|
||||
tox.env: py312-mode_mitogen
|
||||
Loc_312_10:
|
||||
tox.env: py312-mode_localhost-ansible10
|
||||
Van_312_10:
|
||||
tox.env: py312-mode_localhost-ansible10-strategy_linear
|
||||
|
||||
- job: Linux
|
||||
pool:
|
||||
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: azure-pipelines-steps.yml
|
||||
strategy:
|
||||
matrix:
|
||||
Mito_27_centos6:
|
||||
tox.env: py27-mode_mitogen-distro_centos6
|
||||
Mito_27_centos7:
|
||||
tox.env: py27-mode_mitogen-distro_centos7
|
||||
Mito_27_centos8:
|
||||
tox.env: py27-mode_mitogen-distro_centos8
|
||||
Mito_27_debian9:
|
||||
tox.env: py27-mode_mitogen-distro_debian9
|
||||
Mito_27_debian10:
|
||||
tox.env: py27-mode_mitogen-distro_debian10
|
||||
Mito_27_debian11:
|
||||
tox.env: py27-mode_mitogen-distro_debian11
|
||||
Mito_27_ubuntu1604:
|
||||
tox.env: py27-mode_mitogen-distro_ubuntu1604
|
||||
Mito_27_ubuntu1804:
|
||||
tox.env: py27-mode_mitogen-distro_ubuntu1804
|
||||
Mito_27_ubuntu2004:
|
||||
tox.env: py27-mode_mitogen-distro_ubuntu2004
|
||||
|
||||
Mito_36_centos6:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_centos6
|
||||
Mito_36_centos7:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_centos7
|
||||
Mito_36_centos8:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_centos8
|
||||
Mito_36_debian9:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_debian9
|
||||
Mito_36_debian10:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_debian10
|
||||
Mito_36_debian11:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_debian11
|
||||
Mito_36_ubuntu1604:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_ubuntu1604
|
||||
Mito_36_ubuntu1804:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_ubuntu1804
|
||||
Mito_36_ubuntu2004:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_mitogen-distro_ubuntu2004
|
||||
|
||||
Mito_312_centos6:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_centos6
|
||||
Mito_312_centos7:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_centos7
|
||||
Mito_312_centos8:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_centos8
|
||||
Mito_312_debian9:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_debian9
|
||||
Mito_312_debian10:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_debian10
|
||||
Mito_312_debian11:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_debian11
|
||||
Mito_312_ubuntu1604:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_ubuntu1604
|
||||
Mito_312_ubuntu1804:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_ubuntu1804
|
||||
Mito_312_ubuntu2004:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_mitogen-distro_ubuntu2004
|
||||
|
||||
Ans_27_210:
|
||||
tox.env: py27-mode_ansible-ansible2.10
|
||||
Ans_27_4:
|
||||
tox.env: py27-mode_ansible-ansible4
|
||||
|
||||
Ans_36_210:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_ansible-ansible2.10
|
||||
Ans_36_4:
|
||||
python.version: '3.6'
|
||||
tox.env: py36-mode_ansible-ansible4
|
||||
|
||||
Ans_311_210:
|
||||
python.version: '3.11'
|
||||
tox.env: py311-mode_ansible-ansible2.10
|
||||
Ans_311_3:
|
||||
python.version: '3.11'
|
||||
tox.env: py311-mode_ansible-ansible3
|
||||
Ans_311_4:
|
||||
python.version: '3.11'
|
||||
tox.env: py311-mode_ansible-ansible4
|
||||
Ans_311_5:
|
||||
python.version: '3.11'
|
||||
tox.env: py311-mode_ansible-ansible5
|
||||
Ans_312_6:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_ansible-ansible6
|
||||
Ans_312_7:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_ansible-ansible7
|
||||
Ans_312_8:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_ansible-ansible8
|
||||
Ans_312_9:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_ansible-ansible9
|
||||
Ans_312_10:
|
||||
python.version: '3.12'
|
||||
tox.env: py312-mode_ansible-ansible10
|
@ -0,0 +1,18 @@
|
||||
# Ansible removed its default SSH port in May 2021, defering to the SSH
|
||||
# implementation.
|
||||
# https://github.com/ansible/ansible/commit/45618a6f3856f7332df8afe4adc40d85649a70da
|
||||
|
||||
# Careful templating is needed to preseve the type(s) of expected_ssh_port,
|
||||
# particularly in combination with the assert_equal action plugin.
|
||||
# Do: {{ expected_ssh_port }}
|
||||
# Don't: {{ expected_ssh_port | any_filter }}
|
||||
# Don't: {% if ...%}{{ expected_ssh_port }}{% else %}...{% endif %}
|
||||
# https://stackoverflow.com/questions/66102524/ansible-set-fact-type-cast/66104814#66104814
|
||||
|
||||
- set_fact:
|
||||
expected_ssh_port: null
|
||||
when: ansible_version.full is version('2.11.1', '>=', strict=True)
|
||||
|
||||
- set_fact:
|
||||
expected_ssh_port: 22
|
||||
when: ansible_version.full is version('2.11.1', '<', strict=True)
|
Loading…
Reference in New Issue