From 0b99e6e825f01ddff4fd772e30665b0087f79860 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 19 Feb 2021 09:47:48 +0100 Subject: [PATCH] ci: optimize build process and dependencies (#23) --- .drone.jsonnet | 39 +++++++++++++++++++++++++++------------ .drone.yml | 22 +++++++++++++--------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index d2a742d..08eed75 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -6,6 +6,7 @@ local PythonVersion(pyversion='3.6') = { }, commands: [ 'pip install poetry poetry-dynamic-versioning -qq', + 'poetry config experimental.new-installer false', 'poetry install', 'poetry version', 'poetry run git-batch --help', @@ -32,6 +33,7 @@ local PipelineLint = { commands: [ 'git fetch -tq', 'pip install poetry poetry-dynamic-versioning -qq', + 'poetry config experimental.new-installer false', 'poetry install', 'poetry run yapf -dr ./gitbatch', ], @@ -45,6 +47,7 @@ local PipelineLint = { commands: [ 'git fetch -tq', 'pip install poetry poetry-dynamic-versioning -qq', + 'poetry config experimental.new-installer false', 'poetry install', 'poetry run flake8 ./gitbatch', ], @@ -100,6 +103,7 @@ local PipelineSecurity = { commands: [ 'git fetch -tq', 'pip install poetry poetry-dynamic-versioning -qq', + 'poetry config experimental.new-installer false', 'poetry install', 'poetry run bandit -r ./gitbatch -x ./gitbatch/test', ], @@ -177,24 +181,35 @@ local PipelineBuildPackage = { }; 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', name: 'build-container-' + arch, platform: { os: 'linux', arch: arch, }, - steps: [ - { - 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', - ], - }, + steps: build + [ { name: 'dryrun', image: 'thegeeklab/drone-docker:19', diff --git a/.drone.yml b/.drone.yml index 712eada..cfaaec9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,7 @@ steps: commands: - git fetch -tq - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry run yapf -dr ./gitbatch environment: @@ -22,6 +23,7 @@ steps: commands: - git fetch -tq - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry run flake8 ./gitbatch environment: @@ -51,6 +53,7 @@ steps: image: python:3.6 commands: - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry version - poetry run git-batch --help @@ -63,6 +66,7 @@ steps: image: python:3.7 commands: - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry version - poetry run git-batch --help @@ -75,6 +79,7 @@ steps: image: python:3.8 commands: - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry version - poetry run git-batch --help @@ -87,6 +92,7 @@ steps: image: python:3.9 commands: - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry version - poetry run git-batch --help @@ -118,6 +124,7 @@ steps: commands: - git fetch -tq - pip install poetry poetry-dynamic-versioning -qq + - poetry config experimental.new-installer false - poetry install - poetry run bandit -r ./gitbatch -x ./gitbatch/test environment: @@ -202,11 +209,9 @@ platform: steps: - name: build - image: python:3.9-alpine + image: python:3.9 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 @@ -282,11 +287,9 @@ platform: steps: - name: build - image: python:3.9-alpine + image: python:3.9 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 @@ -364,11 +367,12 @@ steps: - name: build image: python:3.9-alpine 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 - - pip install --upgrade --no-cache-dir pip - pip install poetry poetry-dynamic-versioning -qq - poetry build + environment: + CARGO_NET_GIT_FETCH_WITH_CLI: true - name: dryrun image: thegeeklab/drone-docker:19 @@ -529,6 +533,6 @@ depends_on: --- kind: signature -hmac: ba5d8a0fd0f6223e221c2d6f0f0af662b1c4dacf850bfb054fef4b3f83455906 +hmac: 9dfbb0e1e570c1891f0eef862e933b3e98cc268a96808481dd255a0e2fd3a4d7 ...