fix ci config to work with poetry

This commit is contained in:
Robert Kaussow 2020-12-31 14:27:53 +01:00
parent 6e28765239
commit 4a56989bbf
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
2 changed files with 89 additions and 51 deletions

View File

@ -5,12 +5,13 @@ local PythonVersion(pyversion='3.6') = {
PY_COLORS: 1, PY_COLORS: 1,
}, },
commands: [ commands: [
'pip install -r dev-requirements.txt -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'pip install -qq .', 'poetry install -q',
'ansible-doctor --help', 'poetry version',
'poetry run ansible-later --help',
], ],
depends_on: [ depends_on: [
'clone', 'fetch',
], ],
}; };
@ -43,9 +44,10 @@ local PipelineLint = {
PY_COLORS: 1, PY_COLORS: 1,
}, },
commands: [ commands: [
'pip install -r dev-requirements.txt -qq', 'git fetch -tq',
'pip install -qq .', 'pip install poetry poetry-dynamic-versioning -qq',
'flake8 ./ansibledoctor', 'poetry install -q',
'poetry run flake8 ./ansiblelater',
], ],
}, },
], ],
@ -63,6 +65,13 @@ local PipelineTest = {
arch: 'amd64', arch: 'amd64',
}, },
steps: [ steps: [
{
name: 'fetch',
image: 'python:3.9',
commands: [
'git fetch -tq',
],
},
PythonVersion(pyversion='3.6'), PythonVersion(pyversion='3.6'),
PythonVersion(pyversion='3.7'), PythonVersion(pyversion='3.7'),
PythonVersion(pyversion='3.8'), PythonVersion(pyversion='3.8'),
@ -92,9 +101,10 @@ local PipelineSecurity = {
PY_COLORS: 1, PY_COLORS: 1,
}, },
commands: [ commands: [
'pip install -r dev-requirements.txt -qq', 'git fetch -tq',
'pip install -qq .', 'pip install poetry poetry-dynamic-versioning -qq',
'bandit -r ./ansibledoctor -x ./ansibledoctor/tests', 'poetry install -q',
'poetry run bandit -r ./ansiblelater -x ./ansiblelater/test',
], ],
}, },
], ],
@ -119,7 +129,9 @@ local PipelineBuildPackage = {
name: 'build', name: 'build',
image: 'python:3.9', image: 'python:3.9',
commands: [ commands: [
'python setup.py sdist bdist_wheel', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
], ],
}, },
{ {
@ -145,12 +157,15 @@ local PipelineBuildPackage = {
}, },
{ {
name: 'publish-pypi', name: 'publish-pypi',
image: 'plugins/pypi', image: 'python:3.9',
settings: { commands: [
username: { from_secret: 'pypi_username' }, 'git fetch -tq',
password: { from_secret: 'pypi_password' }, 'pip install poetry poetry-dynamic-versioning -qq',
repository: 'https://upload.pypi.org/legacy/', 'poetry publish -n',
skip_build: true, ],
environment: {
POETRY_HTTP_BASIC_PYPI_USERNAME: { from_secret: 'pypi_username' },
POETRY_HTTP_BASIC_PYPI_PASSWORD: { from_secret: 'pypi_password' },
}, },
when: { when: {
ref: ['refs/tags/**'], ref: ['refs/tags/**'],
@ -178,7 +193,9 @@ local PipelineBuildContainer(arch='amd64') = {
name: 'build', name: 'build',
image: 'python:3.9', image: 'python:3.9',
commands: [ commands: [
'python setup.py bdist_wheel', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
], ],
}, },
{ {

View File

@ -20,9 +20,10 @@ steps:
- name: flake8 - name: flake8
image: python:3.9 image: python:3.9
commands: commands:
- pip install -r dev-requirements.txt -qq - git fetch -tq
- pip install -qq . - pip install poetry poetry-dynamic-versioning -qq
- flake8 ./ansibledoctor - poetry install -q
- poetry run flake8 ./ansiblelater
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
@ -44,49 +45,58 @@ platform:
arch: amd64 arch: amd64
steps: steps:
- name: fetch
image: python:3.9
commands:
- git fetch -tq
- name: python36-pytest - name: python36-pytest
image: python:3.6 image: python:3.6
commands: commands:
- pip install -r dev-requirements.txt -qq - pip install poetry poetry-dynamic-versioning -qq
- pip install -qq . - poetry install -q
- ansible-doctor --help - poetry version
- poetry run ansible-later --help
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
depends_on: depends_on:
- clone - fetch
- name: python37-pytest - name: python37-pytest
image: python:3.7 image: python:3.7
commands: commands:
- pip install -r dev-requirements.txt -qq - pip install poetry poetry-dynamic-versioning -qq
- pip install -qq . - poetry install -q
- ansible-doctor --help - poetry version
- poetry run ansible-later --help
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
depends_on: depends_on:
- clone - fetch
- name: python38-pytest - name: python38-pytest
image: python:3.8 image: python:3.8
commands: commands:
- pip install -r dev-requirements.txt -qq - pip install poetry poetry-dynamic-versioning -qq
- pip install -qq . - poetry install -q
- ansible-doctor --help - poetry version
- poetry run ansible-later --help
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
depends_on: depends_on:
- clone - fetch
- name: python39-pytest - name: python39-pytest
image: python:3.9 image: python:3.9
commands: commands:
- pip install -r dev-requirements.txt -qq - pip install poetry poetry-dynamic-versioning -qq
- pip install -qq . - poetry install -q
- ansible-doctor --help - poetry version
- poetry run ansible-later --help
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
depends_on: depends_on:
- clone - fetch
image_pull_secrets: image_pull_secrets:
- docker_config - docker_config
@ -112,9 +122,10 @@ steps:
- name: bandit - name: bandit
image: python:3.9 image: python:3.9
commands: commands:
- pip install -r dev-requirements.txt -qq - git fetch -tq
- pip install -qq . - pip install poetry poetry-dynamic-versioning -qq
- bandit -r ./ansibledoctor -x ./ansibledoctor/tests - poetry install -q
- poetry run bandit -r ./ansiblelater -x ./ansiblelater/test
environment: environment:
PY_COLORS: 1 PY_COLORS: 1
@ -142,7 +153,9 @@ steps:
- name: build - name: build
image: python:3.9 image: python:3.9
commands: commands:
- python setup.py sdist bdist_wheel - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: checksum - name: checksum
image: alpine image: alpine
@ -165,13 +178,15 @@ steps:
- refs/tags/** - refs/tags/**
- name: publish-pypi - name: publish-pypi
image: plugins/pypi image: python:3.9
settings: commands:
password: - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry publish -n
environment:
POETRY_HTTP_BASIC_PYPI_PASSWORD:
from_secret: pypi_password from_secret: pypi_password
repository: https://upload.pypi.org/legacy/ POETRY_HTTP_BASIC_PYPI_USERNAME:
skip_build: true
username:
from_secret: pypi_username from_secret: pypi_username
when: when:
ref: ref:
@ -201,7 +216,9 @@ steps:
- name: build - name: build
image: python:3.9 image: python:3.9
commands: commands:
- python setup.py bdist_wheel - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun - name: dryrun
image: plugins/docker:19 image: plugins/docker:19
@ -286,7 +303,9 @@ steps:
- name: build - name: build
image: python:3.9 image: python:3.9
commands: commands:
- python setup.py bdist_wheel - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun - name: dryrun
image: plugins/docker:19 image: plugins/docker:19
@ -371,7 +390,9 @@ steps:
- name: build - name: build
image: python:3.9 image: python:3.9
commands: commands:
- python setup.py bdist_wheel - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun - name: dryrun
image: plugins/docker:19 image: plugins/docker:19
@ -636,6 +657,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: acfd425c4c96a36bcb633a3f1a375721b599b350707038fee9bc27d1921526ec hmac: 64ad84841c32a13506ec4d2b888fe86460e089bb0a854871f09ef8974a7f64c2
... ...