# Azure DevOps Pipeline для AnsibleTemplate # Автор: Сергей Антропов # Сайт: https://devops.org.ru trigger: - main - develop pool: vmImage: 'ubuntu-latest' variables: ANSIBLE_FORCE_COLOR: 'true' DOCKER_TLS_CERTDIR: '' stages: - stage: Test displayName: 'Test Stage' jobs: - job: TestJob displayName: 'Run Tests' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.11' displayName: 'Use Python 3.11' - script: | pip install --upgrade pip pip install molecule[docker] ansible-lint ansible-galaxy collection install -r requirements.yml displayName: 'Install Dependencies' - script: | ansible-lint molecule/universal/ displayName: 'Run Ansible Lint' - script: | cd molecule/universal molecule test -s universal displayName: 'Run Molecule Tests' - task: PublishTestResults@2 inputs: testResultsFiles: 'molecule/universal/.molecule/reports/junit.xml' testRunTitle: 'Molecule Test Results' condition: always() - task: PublishBuildArtifacts@1 inputs: pathToPublish: 'molecule/universal/.molecule' artifactName: 'molecule-reports' condition: always()