mirror of
https://github.com/thegeeklab/docker-tidy.git
synced 2024-11-22 12:10:40 +00:00
ci: optimize build process and dependencies (#41)
This commit is contained in:
parent
14c961f8db
commit
4f42266489
@ -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',
|
'poetry install',
|
||||||
'poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail',
|
'poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail',
|
||||||
'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 ./dockertidy',
|
'poetry run yapf -dr ./dockertidy',
|
||||||
],
|
],
|
||||||
@ -46,6 +48,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 flake8 ./dockertidy',
|
'poetry run flake8 ./dockertidy',
|
||||||
],
|
],
|
||||||
@ -119,6 +122,7 @@ local PipelineSecurity = {
|
|||||||
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 bandit -r ./dockertidy -x ./dockertidy/test',
|
'poetry run bandit -r ./dockertidy -x ./dockertidy/test',
|
||||||
],
|
],
|
||||||
@ -196,24 +200,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',
|
||||||
|
22
.drone.yml
22
.drone.yml
@ -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 ./dockertidy
|
- poetry run yapf -dr ./dockertidy
|
||||||
environment:
|
environment:
|
||||||
@ -22,6 +23,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 flake8 ./dockertidy
|
- poetry run flake8 ./dockertidy
|
||||||
environment:
|
environment:
|
||||||
@ -51,6 +53,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
|
- poetry install
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
||||||
- poetry version
|
- poetry version
|
||||||
@ -64,6 +67,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
|
- poetry install
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
||||||
- poetry version
|
- poetry version
|
||||||
@ -77,6 +81,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
|
- poetry install
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
||||||
- poetry version
|
- poetry version
|
||||||
@ -90,6 +95,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
|
- poetry install
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
||||||
- poetry version
|
- poetry version
|
||||||
@ -137,6 +143,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 bandit -r ./dockertidy -x ./dockertidy/test
|
- poetry run bandit -r ./dockertidy -x ./dockertidy/test
|
||||||
environment:
|
environment:
|
||||||
@ -221,11 +228,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 +306,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 +386,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 +637,6 @@ depends_on:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: a3765d4fd13eb8c384a30f785ecbc02d3f45dc5cbcf44c17fbb7af039c46e531
|
hmac: bee34a1359dbf20fcb5bf7255abd322c65612a1916416e8a4b79b6c796d7d065
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user