ci: optimize build process and dependencies (#84)

This commit is contained in:
Robert Kaussow 2021-02-19 09:48:31 +01:00 committed by GitHub
parent d57fe8df42
commit aeaa1dc8e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 21 deletions

View File

@ -6,6 +6,7 @@ local PythonVersion(pyversion='3.6') = {
}, },
commands: [ commands: [
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install -E ansible-base', 'poetry install -E ansible-base',
'poetry run pytest', 'poetry run pytest',
'poetry version', 'poetry version',
@ -33,6 +34,7 @@ local PipelineLint = {
commands: [ commands: [
'git fetch -tq', 'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq', 'pip install poetry poetry-dynamic-versioning -qq',
'poetry config experimental.new-installer false',
'poetry install', 'poetry install',
'poetry run yapf -dr ./ansiblelater', 'poetry run yapf -dr ./ansiblelater',
], ],
@ -196,24 +198,35 @@ local PipelineBuildPackage = {
}; };
local PipelineBuildContainer(arch='amd64') = { local PipelineBuildContainer(arch='amd64') = {
local build = if arch == 'arm' then [{
name: 'build',
image: 'python:3.9-alpine',
commands: [
'apk add -Uq --no-cache build-base libressl-dev libffi-dev musl-dev python3-dev git cargo',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
environment: {
CARGO_NET_GIT_FETCH_WITH_CLI: true,
},
}] else [{
name: 'build',
image: 'python:3.9',
commands: [
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
}],
kind: 'pipeline', kind: 'pipeline',
name: 'build-container-' + arch, name: 'build-container-' + arch,
platform: { platform: {
os: 'linux', os: 'linux',
arch: arch, arch: arch,
}, },
steps: [ steps: build + [
{
name: 'build',
image: 'python:3.9-alpine',
commands: [
'apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git',
'git fetch -tq',
'pip install --upgrade --no-cache-dir pip',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
},
{ {
name: 'dryrun', name: 'dryrun',
image: 'thegeeklab/drone-docker:19', image: 'thegeeklab/drone-docker:19',

View File

@ -12,6 +12,7 @@ steps:
commands: commands:
- git fetch -tq - git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install - poetry install
- poetry run yapf -dr ./ansiblelater - poetry run yapf -dr ./ansiblelater
environment: environment:
@ -51,6 +52,7 @@ steps:
image: python:3.6 image: python:3.6
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install -E ansible-base - poetry install -E ansible-base
- poetry run pytest - poetry run pytest
- poetry version - poetry version
@ -64,6 +66,7 @@ steps:
image: python:3.7 image: python:3.7
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install -E ansible-base - poetry install -E ansible-base
- poetry run pytest - poetry run pytest
- poetry version - poetry version
@ -77,6 +80,7 @@ steps:
image: python:3.8 image: python:3.8
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install -E ansible-base - poetry install -E ansible-base
- poetry run pytest - poetry run pytest
- poetry version - poetry version
@ -90,6 +94,7 @@ steps:
image: python:3.9 image: python:3.9
commands: commands:
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry config experimental.new-installer false
- poetry install -E ansible-base - poetry install -E ansible-base
- poetry run pytest - poetry run pytest
- poetry version - poetry version
@ -221,11 +226,9 @@ platform:
steps: steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
@ -301,11 +304,9 @@ platform:
steps: steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
@ -383,11 +384,12 @@ steps:
- name: build - name: build
image: python:3.9-alpine image: python:3.9-alpine
commands: commands:
- apk --update --quiet add build-base libffi-dev musl-dev libressl-dev python3-dev cargo git - apk add -Uq --no-cache build-base libressl-dev libffi-dev musl-dev python3-dev git cargo
- git fetch -tq - git fetch -tq
- pip install --upgrade --no-cache-dir pip
- pip install poetry poetry-dynamic-versioning -qq - pip install poetry poetry-dynamic-versioning -qq
- poetry build - poetry build
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- name: dryrun - name: dryrun
image: thegeeklab/drone-docker:19 image: thegeeklab/drone-docker:19
@ -633,6 +635,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: a3c1fab4fd9b55b5c90d443ade4979500139863a28e417e679ef9157909217ce hmac: b3355b546c9c55cb7c83d1a6b2ae59ec4177e6495b050bc8ecae62bb7a61eceb
... ...

View File

@ -8,6 +8,7 @@ LABEL org.opencontainers.image.source="https://github.com/thegeeklab/ansible-lat
LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/" LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/"
ENV PY_COLORS=1 ENV PY_COLORS=1
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ADD dist/ansible_later-*.whl / ADD dist/ansible_later-*.whl /

View File

@ -8,6 +8,7 @@ LABEL org.opencontainers.image.source="https://github.com/thegeeklab/ansible-lat
LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/" LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/"
ENV PY_COLORS=1 ENV PY_COLORS=1
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ADD dist/ansible_later-*.whl / ADD dist/ansible_later-*.whl /

View File

@ -8,6 +8,7 @@ LABEL org.opencontainers.image.source="https://github.com/thegeeklab/ansible-lat
LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/" LABEL org.opencontainers.image.documentation="https://ansible-later.geekdocs.de/"
ENV PY_COLORS=1 ENV PY_COLORS=1
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ADD dist/ansible_later-*.whl / ADD dist/ansible_later-*.whl /