mirror of
https://github.com/thegeeklab/docker-autotag.git
synced 2024-07-01 05:40:50 +02:00
Compare commits
272 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
819a9aee5f | ||
|
40e871020f | ||
|
455ffa6290 | ||
|
a8ae0e6d7a | ||
|
dcb674e2eb | ||
|
6e92ddc58a | ||
|
cd5ceedc21 | ||
|
452ba20de4 | ||
|
b15541ccfd | ||
|
1135b338e5 | ||
|
3a63829ae7 | ||
|
2e60105935 | ||
|
48858eb1c6 | ||
|
0184f49b36 | ||
|
7380eaf2eb | ||
|
81db3affad | ||
|
f6489fa0b5 | ||
|
643296e083 | ||
|
01fe9c85d3 | ||
|
2120f70dc9 | ||
|
0a3eb0b962 | ||
|
42e31653c2 | ||
|
ebd4eac587 | ||
|
c24a6b3cdd | ||
|
5f042adcf3 | ||
|
31fd0eb50e | ||
|
35befa5aaa | ||
|
9dcb54313b | ||
|
01b2921d7d | ||
fd23fe40e7 | |||
|
0b81a2f5d5 | ||
|
033d549aa0 | ||
|
30dadde4f4 | ||
|
d5a3c5fca7 | ||
|
f5f4a5be16 | ||
|
ddd56aadee | ||
10ece51322 | |||
529e701586 | |||
|
2852334ddc | ||
0fb0e1124e | |||
|
2cdb9e67d6 | ||
|
023495b89b | ||
|
47f575e95c | ||
|
62c5469995 | ||
|
9032f0e1aa | ||
|
b6941b2851 | ||
|
e2443e73d4 | ||
|
403dd9840b | ||
|
641c8bcfc1 | ||
|
8e1309f07e | ||
|
bd578c1550 | ||
c389bb1ffe | |||
b57eac1205 | |||
|
210ead10a8 | ||
42355fbb9b | |||
|
81feb30694 | ||
|
d29b0dd77b | ||
20e2e6a8c7 | |||
|
a177e97e61 | ||
|
1357353e3d | ||
|
c409b85022 | ||
cbd67653e1 | |||
|
347388472d | ||
|
03ba6481c7 | ||
efd778e162 | |||
|
77f087840d | ||
e7dd82cf92 | |||
3c4b7d9f9d | |||
|
e5ec7bb741 | ||
584054dda0 | |||
36cdffcca1 | |||
d4fc4357cc | |||
|
6f67c32841 | ||
d5f06425dd | |||
e867939a71 | |||
|
42d61889e8 | ||
|
7f173f1423 | ||
|
fa3e1c7fb8 | ||
|
2edda529c6 | ||
|
529fd0b8f5 | ||
|
e8726e0f3b | ||
|
5faea1240d | ||
|
70f720dc3b | ||
|
2d6fb5c6e7 | ||
|
b7b229695c | ||
b21d62c78d | |||
|
12ef38313f | ||
f8f95fe649 | |||
|
aacc74124a | ||
|
96b589f59a | ||
|
cdb138c41c | ||
|
70a4fa057c | ||
|
2a1d056adb | ||
|
7abc232810 | ||
|
3df02e4a3e | ||
|
443269ae71 | ||
|
fb81c8bdb8 | ||
|
25e9bd47c4 | ||
|
c2144e0f1b | ||
|
b1e08ae0d1 | ||
|
9be186eaba | ||
|
24c4073be2 | ||
|
9878326fc2 | ||
7f20729c37 | |||
|
9cc91ca493 | ||
|
677db3edd1 | ||
25e1e420d6 | |||
|
63c888c631 | ||
|
ee0753d4b7 | ||
|
8df30bc6c0 | ||
|
4cae9c5995 | ||
03d67ff147 | |||
|
e8cc0165e4 | ||
|
2c9fd53544 | ||
|
f8ac7e81fe | ||
f9ab6bb9f3 | |||
|
6fe925dd32 | ||
|
9480584999 | ||
|
5ae3030353 | ||
|
19e20e7bf0 | ||
|
f630cb16de | ||
|
25fe648f46 | ||
|
6612a115c8 | ||
|
ea1a771303 | ||
|
f729a8bb98 | ||
|
32829d469d | ||
|
e91d02201d | ||
|
9e0bd522f8 | ||
a1fbabd605 | |||
|
3f5a5ac6a2 | ||
|
38dc002456 | ||
|
7dbdc9d2bc | ||
|
0bbc2922be | ||
8fe82a7d65 | |||
|
c356b55b9b | ||
16137e064c | |||
|
57e8c9ffac | ||
cbffcb6c79 | |||
|
d2fb6d7438 | ||
|
b3a481a7a1 | ||
|
3bd1b660b4 | ||
|
bf23653e19 | ||
|
805ef9b670 | ||
c886d6cc0f | |||
|
73b11be5d3 | ||
|
792e7eb6b1 | ||
|
af74262c0a | ||
|
b7ac6fc58a | ||
a79e8c5b81 | |||
|
6080b89b69 | ||
|
9d771d78c1 | ||
|
168e67afbb | ||
|
27bd048a67 | ||
|
31357ec4de | ||
|
7c78573d87 | ||
253f4e2c28 | |||
|
c71deeff2d | ||
|
cb00a19273 | ||
|
a236a12d5f | ||
|
ab7422c735 | ||
|
32b2fb1e28 | ||
e01356b1fe | |||
|
22f0f390a7 | ||
|
44724e408f | ||
|
04bbeaca66 | ||
|
0721d6e176 | ||
|
7dcff5b553 | ||
|
5a683e5a04 | ||
|
e3ef3b2fa7 | ||
|
d494f3e6db | ||
|
054fef98e4 | ||
|
c57c6914e1 | ||
|
59ff380fc2 | ||
|
70ce89f138 | ||
|
76ac9f4fc9 | ||
|
45594aff05 | ||
|
83baed69a5 | ||
|
ece672c816 | ||
|
3b405ab5db | ||
|
1529cdfb84 | ||
|
3ce6396fa1 | ||
|
f6d176bb7d | ||
|
e3347e1275 | ||
|
32d0ef100e | ||
|
f061937dbc | ||
|
01859dfc3b | ||
|
6d28c9a6fb | ||
|
2ac49f98df | ||
|
2fe2665426 | ||
|
35b06157a7 | ||
|
841b4045ff | ||
|
20b705d1c6 | ||
|
4ed334480a | ||
|
a895ad1236 | ||
|
66b1af0494 | ||
|
8f3148e5a0 | ||
cd00b2d8b1 | |||
|
bcf579b7a7 | ||
|
ce05171e0c | ||
e124c7aeef | |||
|
b17b71b3bc | ||
|
f150e4abd3 | ||
|
44763205a6 | ||
|
9013547254 | ||
|
8f65adfee8 | ||
|
542c02582c | ||
|
0687883ed5 | ||
|
728ea3bfa6 | ||
|
9855397550 | ||
3813f7c6b1 | |||
|
ce991cc745 | ||
|
b9a6b9aa21 | ||
|
b3623bae2f | ||
|
9fc8f8aafb | ||
|
6a7fe173b7 | ||
|
dfccb78e2d | ||
|
556e1072cb | ||
|
14acdb3c95 | ||
|
dbecd818f6 | ||
|
41c0f80de6 | ||
|
0ae56a8755 | ||
|
bd72e12855 | ||
|
339f0b5582 | ||
|
1625329018 | ||
|
5cc70a7930 | ||
f577139a45 | |||
|
46a0fe286f | ||
|
f4fa2440d9 | ||
|
e196a1bbe5 | ||
|
600fd724a1 | ||
|
6e6811f6c7 | ||
|
540b6545f1 | ||
|
e9863a7c5f | ||
|
c399903c6d | ||
|
efe8f8b46a | ||
|
9fda149c3d | ||
|
2e8c92002c | ||
|
f7e9bed02d | ||
|
0e8ef41d9b | ||
|
8f7472a489 | ||
|
0853bee5d4 | ||
|
829acce8fa | ||
|
f0719ca533 | ||
|
7ffa8ffedd | ||
|
c683682f9b | ||
6a73de0d41 | |||
|
f97127c625 | ||
|
55367940ae | ||
|
e50a630244 | ||
2abf6798f5 | |||
|
635c1f4942 | ||
|
b49127f7bc | ||
f2f82007bd | |||
6c4e6b86bc | |||
|
d7807ef46c | ||
|
a3c2a76868 | ||
|
467d2072f1 | ||
|
c27a953cbf | ||
|
b187d07a35 | ||
|
486ccc9a4f | ||
|
6646811ec5 | ||
|
1413d1133b | ||
f2df28eecb | |||
e4c2fe2e09 | |||
|
0a8b49e0a6 | ||
|
86c301435c | ||
|
6b1ccc40f4 | ||
|
aab55887a5 | ||
|
61e4faded4 | ||
|
c8716c59d4 | ||
|
0191a571bc | ||
|
3d60588dbd |
|
@ -1,23 +0,0 @@
|
||||||
# Changelog
|
|
||||||
|
|
||||||
{{ range .Versions -}}
|
|
||||||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
|
|
||||||
|
|
||||||
{{ range .CommitGroups -}}
|
|
||||||
### {{ .Title }}
|
|
||||||
|
|
||||||
{{ range .Commits -}}
|
|
||||||
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") | trim }}
|
|
||||||
{{ end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- if .NoteGroups -}}
|
|
||||||
{{ range .NoteGroups -}}
|
|
||||||
### {{ .Title }}
|
|
||||||
|
|
||||||
{{ range .Notes }}
|
|
||||||
{{ .Body }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
|
@ -1,25 +0,0 @@
|
||||||
style: github
|
|
||||||
template: CHANGELOG.tpl.md
|
|
||||||
info:
|
|
||||||
title: CHANGELOG
|
|
||||||
repository_url: https://github.com/thegeeklab/docker-autotag
|
|
||||||
options:
|
|
||||||
commit_groups:
|
|
||||||
title_maps:
|
|
||||||
feat: Features
|
|
||||||
fix: Bug Fixes
|
|
||||||
perf: Performance Improvements
|
|
||||||
refactor: Code Refactoring
|
|
||||||
chore: Others
|
|
||||||
test: Testing
|
|
||||||
ci: CI Pipeline
|
|
||||||
docs: Documentation
|
|
||||||
header:
|
|
||||||
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
|
|
||||||
pattern_maps:
|
|
||||||
- Type
|
|
||||||
- Scope
|
|
||||||
- Subject
|
|
||||||
notes:
|
|
||||||
keywords:
|
|
||||||
- BREAKING CHANGE
|
|
2
.dictionary
Normal file
2
.dictionary
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
PyPi
|
||||||
|
docker-autotag
|
391
.drone.jsonnet
391
.drone.jsonnet
|
@ -1,391 +0,0 @@
|
||||||
local PythonVersion(pyversion='3.7') = {
|
|
||||||
name: 'python' + std.strReplace(pyversion, '.', '') + '-pytest',
|
|
||||||
image: 'python:' + pyversion,
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry version',
|
|
||||||
'poetry run docker-autotag --help',
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'fetch',
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineLint = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'lint',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'yapf',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run yapf -dr ./dockerautotag',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flake8',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run flake8 ./dockerautotag',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineTest = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'test',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'fetch',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
PythonVersion(pyversion='3.7'),
|
|
||||||
PythonVersion(pyversion='3.8'),
|
|
||||||
PythonVersion(pyversion='3.9'),
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'lint',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineSecurity = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'security',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'bandit',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run bandit -r ./dockerautotag -x ./dockerautotag/test',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'test',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineBuildPackage = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'build-package',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'build',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry build',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'checksum',
|
|
||||||
image: 'alpine',
|
|
||||||
commands: [
|
|
||||||
'cd dist/ && sha256sum * > ../sha256sum.txt',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'changelog-generate',
|
|
||||||
image: 'thegeeklab/git-chglog',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'changelog-format',
|
|
||||||
image: 'thegeeklab/alpine-tools',
|
|
||||||
commands: [
|
|
||||||
'prettier CHANGELOG.md',
|
|
||||||
'prettier -w CHANGELOG.md',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-github',
|
|
||||||
image: 'plugins/github-release',
|
|
||||||
settings: {
|
|
||||||
overwrite: true,
|
|
||||||
api_key: { from_secret: 'github_token' },
|
|
||||||
files: ['dist/*', 'sha256sum.txt'],
|
|
||||||
title: '${DRONE_TAG}',
|
|
||||||
note: 'CHANGELOG.md',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-pypi',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry publish -n',
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
POETRY_HTTP_BASIC_PYPI_USERNAME: { from_secret: 'pypi_username' },
|
|
||||||
POETRY_HTTP_BASIC_PYPI_PASSWORD: { from_secret: 'pypi_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'security',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
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 openssl-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: build + [
|
|
||||||
{
|
|
||||||
name: 'dryrun',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
dry_run: true,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
repo: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
},
|
|
||||||
depends_on: ['build'],
|
|
||||||
when: {
|
|
||||||
ref: ['refs/pull/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-dockerhub',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
auto_tag: true,
|
|
||||||
auto_tag_suffix: arch,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
repo: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
|
||||||
},
|
|
||||||
depends_on: ['dryrun'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-quay',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
auto_tag: true,
|
|
||||||
auto_tag_suffix: arch,
|
|
||||||
dockerfile: 'docker/Dockerfile.' + arch,
|
|
||||||
registry: 'quay.io',
|
|
||||||
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
username: { from_secret: 'quay_username' },
|
|
||||||
password: { from_secret: 'quay_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
|
||||||
},
|
|
||||||
depends_on: ['dryrun'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'security',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineNotifications = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'notifications',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
image: 'plugins/manifest',
|
|
||||||
name: 'manifest-dockerhub',
|
|
||||||
settings: {
|
|
||||||
ignore_missing: true,
|
|
||||||
auto_tag: true,
|
|
||||||
username: { from_secret: 'docker_username' },
|
|
||||||
password: { from_secret: 'docker_password' },
|
|
||||||
spec: 'docker/manifest.tmpl',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: 'plugins/manifest',
|
|
||||||
name: 'manifest-quay',
|
|
||||||
settings: {
|
|
||||||
ignore_missing: true,
|
|
||||||
auto_tag: true,
|
|
||||||
username: { from_secret: 'quay_username' },
|
|
||||||
password: { from_secret: 'quay_password' },
|
|
||||||
spec: 'docker/manifest-quay.tmpl',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'pushrm-dockerhub',
|
|
||||||
pull: 'always',
|
|
||||||
image: 'chko/docker-pushrm:1',
|
|
||||||
environment: {
|
|
||||||
DOCKER_PASS: {
|
|
||||||
from_secret: 'docker_password',
|
|
||||||
},
|
|
||||||
DOCKER_USER: {
|
|
||||||
from_secret: 'docker_username',
|
|
||||||
},
|
|
||||||
PUSHRM_FILE: 'README.md',
|
|
||||||
PUSHRM_SHORT: 'Create docker tags from a given version string',
|
|
||||||
PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'pushrm-quay',
|
|
||||||
pull: 'always',
|
|
||||||
image: 'chko/docker-pushrm:1',
|
|
||||||
environment: {
|
|
||||||
APIKEY__QUAY_IO: {
|
|
||||||
from_secret: 'quay_token',
|
|
||||||
},
|
|
||||||
PUSHRM_FILE: 'README.md',
|
|
||||||
PUSHRM_TARGET: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'matrix',
|
|
||||||
image: 'thegeeklab/drone-matrix',
|
|
||||||
settings: {
|
|
||||||
homeserver: { from_secret: 'matrix_homeserver' },
|
|
||||||
roomid: { from_secret: 'matrix_roomid' },
|
|
||||||
template: 'Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}',
|
|
||||||
username: { from_secret: 'matrix_username' },
|
|
||||||
password: { from_secret: 'matrix_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success', 'failure'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'build-package',
|
|
||||||
'build-container-amd64',
|
|
||||||
'build-container-arm64',
|
|
||||||
'build-container-arm',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
|
||||||
status: ['success', 'failure'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
[
|
|
||||||
PipelineLint,
|
|
||||||
PipelineTest,
|
|
||||||
PipelineSecurity,
|
|
||||||
PipelineBuildPackage,
|
|
||||||
PipelineBuildContainer(arch='amd64'),
|
|
||||||
PipelineBuildContainer(arch='arm64'),
|
|
||||||
PipelineBuildContainer(arch='arm'),
|
|
||||||
PipelineNotifications,
|
|
||||||
]
|
|
537
.drone.yml
537
.drone.yml
|
@ -1,537 +0,0 @@
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: lint
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: yapf
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run yapf -dr ./dockerautotag
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
- name: flake8
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run flake8 ./dockerautotag
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: fetch
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
|
|
||||||
- name: python37-pytest
|
|
||||||
image: python:3.7
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-autotag --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: python38-pytest
|
|
||||||
image: python:3.8
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-autotag --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: python39-pytest
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-autotag --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: security
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: bandit
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run bandit -r ./dockerautotag -x ./dockerautotag/test
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-package
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: checksum
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- cd dist/ && sha256sum * > ../sha256sum.txt
|
|
||||||
|
|
||||||
- name: changelog-generate
|
|
||||||
image: thegeeklab/git-chglog
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
|
|
||||||
|
|
||||||
- name: changelog-format
|
|
||||||
image: thegeeklab/alpine-tools
|
|
||||||
commands:
|
|
||||||
- prettier CHANGELOG.md
|
|
||||||
- prettier -w CHANGELOG.md
|
|
||||||
|
|
||||||
- name: publish-github
|
|
||||||
image: plugins/github-release
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: github_token
|
|
||||||
files:
|
|
||||||
- dist/*
|
|
||||||
- sha256sum.txt
|
|
||||||
note: CHANGELOG.md
|
|
||||||
overwrite: true
|
|
||||||
title: ${DRONE_TAG}
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
- name: publish-pypi
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry publish -n
|
|
||||||
environment:
|
|
||||||
POETRY_HTTP_BASIC_PYPI_PASSWORD:
|
|
||||||
from_secret: pypi_password
|
|
||||||
POETRY_HTTP_BASIC_PYPI_USERNAME:
|
|
||||||
from_secret: pypi_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-amd64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
dockerfile: docker/Dockerfile.amd64
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
dockerfile: docker/Dockerfile.arm64
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9-alpine
|
|
||||||
commands:
|
|
||||||
- apk add -Uq --no-cache build-base openssl-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
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
dry_run: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/pull/**
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
- name: publish-dockerhub
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
- name: publish-quay
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
registry: quay.io
|
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
depends_on:
|
|
||||||
- dryrun
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: notifications
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: manifest-dockerhub
|
|
||||||
image: plugins/manifest
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
ignore_missing: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
spec: docker/manifest.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: manifest-quay
|
|
||||||
image: plugins/manifest
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
ignore_missing: true
|
|
||||||
password:
|
|
||||||
from_secret: quay_password
|
|
||||||
spec: docker/manifest-quay.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: quay_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: pushrm-dockerhub
|
|
||||||
pull: always
|
|
||||||
image: chko/docker-pushrm:1
|
|
||||||
environment:
|
|
||||||
DOCKER_PASS:
|
|
||||||
from_secret: docker_password
|
|
||||||
DOCKER_USER:
|
|
||||||
from_secret: docker_username
|
|
||||||
PUSHRM_FILE: README.md
|
|
||||||
PUSHRM_SHORT: Create docker tags from a given version string
|
|
||||||
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: pushrm-quay
|
|
||||||
pull: always
|
|
||||||
image: chko/docker-pushrm:1
|
|
||||||
environment:
|
|
||||||
APIKEY__QUAY_IO:
|
|
||||||
from_secret: quay_token
|
|
||||||
PUSHRM_FILE: README.md
|
|
||||||
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: matrix
|
|
||||||
image: thegeeklab/drone-matrix
|
|
||||||
settings:
|
|
||||||
homeserver:
|
|
||||||
from_secret: matrix_homeserver
|
|
||||||
password:
|
|
||||||
from_secret: matrix_password
|
|
||||||
roomid:
|
|
||||||
from_secret: matrix_roomid
|
|
||||||
template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
|
|
||||||
username:
|
|
||||||
from_secret: matrix_username
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build-package
|
|
||||||
- build-container-amd64
|
|
||||||
- build-container-arm64
|
|
||||||
- build-container-arm
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: signature
|
|
||||||
hmac: 96929fe2dbc8b669cc584b68b7ccf0663cdfb7658088a0b3b34d49aad4ad5888
|
|
||||||
|
|
||||||
...
|
|
9
.github/settings.yml
vendored
9
.github/settings.yml
vendored
|
@ -51,6 +51,11 @@ branches:
|
||||||
required_status_checks:
|
required_status_checks:
|
||||||
strict: false
|
strict: false
|
||||||
contexts:
|
contexts:
|
||||||
- continuous-integration/drone/pr
|
- ci/woodpecker/pr/lint
|
||||||
enforce_admins: null
|
- ci/woodpecker/pr/test
|
||||||
|
- ci/woodpecker/pr/build-package
|
||||||
|
- ci/woodpecker/pr/build-container
|
||||||
|
- ci/woodpecker/pr/docs
|
||||||
|
enforce_admins: false
|
||||||
|
required_linear_history: true
|
||||||
restrictions: null
|
restrictions: null
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -104,3 +104,4 @@ pip-wheel-metadata
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
CHANGELOG.md
|
CHANGELOG.md
|
||||||
|
.ruff_cache
|
||||||
|
|
47
.gitsv/config.yml
Normal file
47
.gitsv/config.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
---
|
||||||
|
version: "1.1"
|
||||||
|
|
||||||
|
versioning:
|
||||||
|
update-major: []
|
||||||
|
update-minor: [feat]
|
||||||
|
update-patch: [fix, perf, refactor, chore, test, ci, docs]
|
||||||
|
|
||||||
|
tag:
|
||||||
|
pattern: "v%d.%d.%d"
|
||||||
|
|
||||||
|
release-notes:
|
||||||
|
sections:
|
||||||
|
- name: Features
|
||||||
|
commit-types: [feat]
|
||||||
|
section-type: commits
|
||||||
|
- name: Bug Fixes
|
||||||
|
commit-types: [fix]
|
||||||
|
section-type: commits
|
||||||
|
- name: Performance Improvements
|
||||||
|
commit-types: [perf]
|
||||||
|
section-type: commits
|
||||||
|
- name: Code Refactoring
|
||||||
|
commit-types: [refactor]
|
||||||
|
section-type: commits
|
||||||
|
- name: Others
|
||||||
|
commit-types: [chore]
|
||||||
|
section-type: commits
|
||||||
|
- name: Testing
|
||||||
|
commit-types: [test]
|
||||||
|
section-type: commits
|
||||||
|
- name: CI Pipeline
|
||||||
|
commit-types: [ci]
|
||||||
|
section-type: commits
|
||||||
|
- name: Documentation
|
||||||
|
commit-types: [docs]
|
||||||
|
section-type: commits
|
||||||
|
- name: Breaking Changes
|
||||||
|
section-type: breaking-changes
|
||||||
|
|
||||||
|
commit-message:
|
||||||
|
footer:
|
||||||
|
issue:
|
||||||
|
key: issue
|
||||||
|
add-value-prefix: "#"
|
||||||
|
issue:
|
||||||
|
regex: "#?[0-9]+"
|
1
.lycheeignore
Normal file
1
.lycheeignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
https://hub.docker.com/r/thegeeklab/*
|
6
.markdownlint.yml
Normal file
6
.markdownlint.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
default: True
|
||||||
|
MD013: False
|
||||||
|
MD041: False
|
||||||
|
MD004:
|
||||||
|
style: dash
|
|
@ -1,2 +1,2 @@
|
||||||
.drone.yml
|
|
||||||
*.tpl.md
|
*.tpl.md
|
||||||
|
LICENSE
|
||||||
|
|
73
.woodpecker/build-container.yml
Normal file
73
.woodpecker/build-container.yml
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry build
|
||||||
|
|
||||||
|
- name: dryrun
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:4
|
||||||
|
settings:
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
dry_run: true
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
provenance: false
|
||||||
|
repo: ${CI_REPO}
|
||||||
|
when:
|
||||||
|
- event: [pull_request]
|
||||||
|
|
||||||
|
- name: publish-dockerhub
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:4
|
||||||
|
group: container
|
||||||
|
settings:
|
||||||
|
auto_tag: true
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
provenance: false
|
||||||
|
repo: ${CI_REPO}
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
- name: publish-quay
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:4
|
||||||
|
group: container
|
||||||
|
settings:
|
||||||
|
auto_tag: true
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
password:
|
||||||
|
from_secret: quay_password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
provenance: false
|
||||||
|
registry: quay.io
|
||||||
|
repo: quay.io/${CI_REPO}
|
||||||
|
username:
|
||||||
|
from_secret: quay_username
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
- test
|
56
.woodpecker/build-package.yml
Normal file
56
.woodpecker/build-package.yml
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry build
|
||||||
|
|
||||||
|
- name: checksum
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
commands:
|
||||||
|
- cd dist/ && sha256sum * > ../sha256sum.txt
|
||||||
|
|
||||||
|
- name: changelog
|
||||||
|
image: quay.io/thegeeklab/git-sv
|
||||||
|
commands:
|
||||||
|
- git sv current-version
|
||||||
|
- git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md
|
||||||
|
- cat CHANGELOG.md
|
||||||
|
|
||||||
|
- name: publish-github
|
||||||
|
image: docker.io/plugins/github-release
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: github_token
|
||||||
|
files:
|
||||||
|
- dist/*
|
||||||
|
- sha256sum.txt
|
||||||
|
note: CHANGELOG.md
|
||||||
|
overwrite: true
|
||||||
|
title: ${CI_COMMIT_TAG}
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
|
- name: publish-pypi
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
secrets:
|
||||||
|
- source: pypi_password
|
||||||
|
target: POETRY_HTTP_BASIC_PYPI_PASSWORD
|
||||||
|
- source: pypi_username
|
||||||
|
target: POETRY_HTTP_BASIC_PYPI_USERNAME
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry publish -n
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
- test
|
62
.woodpecker/docs.yml
Normal file
62
.woodpecker/docs.yml
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: markdownlint
|
||||||
|
image: quay.io/thegeeklab/markdownlint-cli
|
||||||
|
group: test
|
||||||
|
commands:
|
||||||
|
- markdownlint 'README.md' 'CONTRIBUTING.md'
|
||||||
|
|
||||||
|
- name: spellcheck
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
group: test
|
||||||
|
commands:
|
||||||
|
- spellchecker --files 'docs/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls
|
||||||
|
environment:
|
||||||
|
FORCE_COLOR: "true"
|
||||||
|
|
||||||
|
- name: link-validation
|
||||||
|
image: docker.io/lycheeverse/lychee
|
||||||
|
group: test
|
||||||
|
commands:
|
||||||
|
- lychee --no-progress --format detailed README.md
|
||||||
|
|
||||||
|
- name: pushrm-dockerhub
|
||||||
|
image: docker.io/chko/docker-pushrm:1
|
||||||
|
secrets:
|
||||||
|
- source: docker_password
|
||||||
|
target: DOCKER_PASS
|
||||||
|
- source: docker_username
|
||||||
|
target: DOCKER_USER
|
||||||
|
environment:
|
||||||
|
PUSHRM_FILE: README.md
|
||||||
|
PUSHRM_SHORT: Create docker tags from a given version string
|
||||||
|
PUSHRM_TARGET: ${CI_REPO}
|
||||||
|
when:
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [success]
|
||||||
|
|
||||||
|
- name: pushrm-quay
|
||||||
|
image: docker.io/chko/docker-pushrm:1
|
||||||
|
secrets:
|
||||||
|
- source: quay_token
|
||||||
|
target: APIKEY__QUAY_IO
|
||||||
|
environment:
|
||||||
|
PUSHRM_FILE: README.md
|
||||||
|
PUSHRM_TARGET: quay.io/${CI_REPO}
|
||||||
|
when:
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [success]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build-package
|
||||||
|
- build-container
|
25
.woodpecker/lint.yml
Normal file
25
.woodpecker/lint.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: check-format
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry run ruff format --check --diff ./${CI_REPO_NAME//-/}
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
||||||
|
|
||||||
|
- name: check-coding
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry run ruff check ./${CI_REPO_NAME//-/}
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
26
.woodpecker/notify.yml
Normal file
26
.woodpecker/notify.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
runs_on: [success, failure]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: matrix
|
||||||
|
image: quay.io/thegeeklab/wp-matrix
|
||||||
|
settings:
|
||||||
|
homeserver:
|
||||||
|
from_secret: matrix_homeserver
|
||||||
|
password:
|
||||||
|
from_secret: matrix_password
|
||||||
|
roomid:
|
||||||
|
from_secret: matrix_roomid
|
||||||
|
username:
|
||||||
|
from_secret: matrix_username
|
||||||
|
when:
|
||||||
|
- status: [success, failure]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- docs
|
38
.woodpecker/test.yml
Normal file
38
.woodpecker/test.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- &pytest_base
|
||||||
|
group: pytest
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry version
|
||||||
|
- poetry run ${CI_REPO_NAME} --help
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: python-312
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-311
|
||||||
|
image: docker.io/library/python:3.11
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-310
|
||||||
|
image: docker.io/library/python:3.10
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-39
|
||||||
|
image: docker.io/library/python:3.9
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-38
|
||||||
|
image: docker.io/library/python:3.8
|
||||||
|
<<: *pytest_base
|
|
@ -3,7 +3,7 @@
|
||||||
## Security
|
## Security
|
||||||
|
|
||||||
If you think you have found a **security issue**, please do not mention it in this repository.
|
If you think you have found a **security issue**, please do not mention it in this repository.
|
||||||
Instead, send an email to security@thegeeklab.de with as many details as possible so it can be handled confidential.
|
Instead, send an email to `security@thegeeklab.de` with as many details as possible so it can be handled confidential.
|
||||||
|
|
||||||
## Bug Reports and Feature Requests
|
## Bug Reports and Feature Requests
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM python:3.9-alpine@sha256:55fbe1ef2c62a1607ab702ac14111d9981d6b4f2a62351b75ffe34622f18dc3f
|
FROM python:3.12-alpine@sha256:ff870bf7c2bb546419aaea570f0a1c28c8103b78743a2b8030e9e97391ddf81b
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
|
@ -8,6 +8,7 @@ LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-auto
|
||||||
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/docker-autotag"
|
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/docker-autotag"
|
||||||
|
|
||||||
ENV PY_COLORS=1
|
ENV PY_COLORS=1
|
||||||
|
ENV TZ=UTC
|
||||||
|
|
||||||
ADD dist/docker_autotag-*.whl /
|
ADD dist/docker_autotag-*.whl /
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 Robert Kaussow <mail@thegeeklab.de>
|
Copyright (c) 2022 Robert Kaussow <mail@thegeeklab.de>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Create docker tags from a given version string
|
Create docker tags from a given version string
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/drone/build/thegeeklab/docker-autotag?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/docker-autotag)
|
[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/docker-autotag/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/docker-autotag)
|
||||||
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-autotag)
|
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-autotag)
|
||||||
[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/docker-autotag)
|
[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/docker-autotag)
|
||||||
[![Python Version](https://img.shields.io/pypi/pyversions/docker-autotag.svg)](https://pypi.org/project/docker-autotag/)
|
[![Python Version](https://img.shields.io/pypi/pyversions/docker-autotag.svg)](https://pypi.org/project/docker-autotag/)
|
||||||
|
@ -21,6 +21,8 @@ Simple tool to create a list of docker tags from a given version string.
|
||||||
DOCKER_AUTOTAG_OUTPUT_FILE=
|
DOCKER_AUTOTAG_OUTPUT_FILE=
|
||||||
# adds a given suffix to every determined tag
|
# adds a given suffix to every determined tag
|
||||||
DOCKER_AUTOTAG_SUFFIX=
|
DOCKER_AUTOTAG_SUFFIX=
|
||||||
|
# returns only tags with the applied suffix
|
||||||
|
DOCKER_AUTOTAG_SUFFIX_STRICT=False
|
||||||
# version string to use; returns 'latest' if nothing is specified
|
# version string to use; returns 'latest' if nothing is specified
|
||||||
DOCKER_AUTOTAG_VERSION=
|
DOCKER_AUTOTAG_VERSION=
|
||||||
# comma-seprated list of static tags to add to the result set
|
# comma-seprated list of static tags to add to the result set
|
||||||
|
@ -59,13 +61,16 @@ DOCKER_AUTOTAG_IGNORE_PRERELEASE=True DOCKER_AUTOTAG_VERSION=1.0.0-beta docker-a
|
||||||
DOCKER_AUTOTAG_SUFFIX=amd64 DOCKER_AUTOTAG_VERSION=1.0.0 docker-autotag
|
DOCKER_AUTOTAG_SUFFIX=amd64 DOCKER_AUTOTAG_VERSION=1.0.0 docker-autotag
|
||||||
# 1.0.0,1.0,1,1.0.0-amd64,1.0-amd64,1-amd64
|
# 1.0.0,1.0,1,1.0.0-amd64,1.0-amd64,1-amd64
|
||||||
|
|
||||||
|
DOCKER_AUTOTAG_SUFFIX=amd64 DOCKER_AUTOTAG_SUFFIX_STRICT=True DOCKER_AUTOTAG_VERSION=1.0.0 docker-autotag
|
||||||
|
# 1.0.0-amd64,1.0-amd64,1-amd64
|
||||||
|
|
||||||
DOCKER_AUTOTAG_EXTRA_TAGS=extra1,extra2 DOCKER_AUTOTAG_VERSION=1.0.0 docker-autotag
|
DOCKER_AUTOTAG_EXTRA_TAGS=extra1,extra2 DOCKER_AUTOTAG_VERSION=1.0.0 docker-autotag
|
||||||
# 1.0.0,1.0,1,extra1,extra2
|
# 1.0.0,1.0,1,extra1,extra2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
Special thanks goes to all [contributors](https://github.com/thegeeklab/docker-autotag/graphs/contributors). If you would like to contribute,
|
Special thanks to all [contributors](https://github.com/thegeeklab/docker-autotag/graphs/contributors). If you would like to contribute,
|
||||||
please see the [instructions](https://github.com/thegeeklab/docker-autotag/blob/main/CONTRIBUTING.md).
|
please see the [instructions](https://github.com/thegeeklab/docker-autotag/blob/main/CONTRIBUTING.md).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
FROM arm32v7/python:3.9-alpine@sha256:4b7733264c4cc10afe9159a41dadeb9638057cfb0f9a0cb3f26e81266f51a568
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
|
|
||||||
ENV PY_COLORS=1
|
|
||||||
|
|
||||||
ADD dist/docker_autotag-*.whl /
|
|
||||||
|
|
||||||
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
|
|
||||||
apk --update add git && \
|
|
||||||
pip install --upgrade --no-cache-dir pip && \
|
|
||||||
pip install --no-cache-dir $(find / -name "docker_autotag-*.whl") && \
|
|
||||||
apk del .build-deps && \
|
|
||||||
rm -f docker_autotag-*.whl && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
rm -rf /root/.cache/
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-autotag"]
|
|
|
@ -1,25 +0,0 @@
|
||||||
FROM arm64v8/python:3.9-alpine@sha256:a9b413e4519b7bde9ddcd3a1faeb4f67eb0bcf044bb036b1fd2d52d5f6758246
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/docker-autotag"
|
|
||||||
|
|
||||||
ENV PY_COLORS=1
|
|
||||||
|
|
||||||
ADD dist/docker_autotag-*.whl /
|
|
||||||
|
|
||||||
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
|
|
||||||
apk --update add git && \
|
|
||||||
pip install --upgrade --no-cache-dir pip && \
|
|
||||||
pip install --no-cache-dir $(find / -name "docker_autotag-*.whl") && \
|
|
||||||
apk del .build-deps && \
|
|
||||||
rm -f docker_autotag-*.whl && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
rm -rf /root/.cache/
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-autotag"]
|
|
|
@ -1,24 +0,0 @@
|
||||||
image: quay.io/thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
- image: quay.io/thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
|
@ -1,24 +0,0 @@
|
||||||
image: thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
- image: thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: thegeeklab/docker-autotag:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
|
@ -3,16 +3,14 @@
|
||||||
import argparse
|
import argparse
|
||||||
import copy
|
import copy
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import semantic_version
|
import semantic_version
|
||||||
|
|
||||||
from dockerautotag import __version__
|
from dockerautotag import __version__
|
||||||
from dockerautotag.logging import SingleLog
|
from dockerautotag.logging import SingleLog
|
||||||
from dockerautotag.utils import normalize_path
|
from dockerautotag.utils import normalize_path, to_bool, to_prerelease, trim_prefix
|
||||||
from dockerautotag.utils import to_bool
|
|
||||||
from dockerautotag.utils import to_prerelease
|
|
||||||
from dockerautotag.utils import trim_prefix
|
|
||||||
|
|
||||||
|
|
||||||
class Autotag:
|
class Autotag:
|
||||||
|
@ -29,9 +27,7 @@ class Autotag:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=("Creates a list of docker tags from a given version string.")
|
description=("Creates a list of docker tags from a given version string.")
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
||||||
"--version", action="version", version="%(prog)s {}".format(__version__)
|
|
||||||
)
|
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
@ -42,6 +38,7 @@ class Autotag:
|
||||||
config["file"] = normalize_path(output_raw)
|
config["file"] = normalize_path(output_raw)
|
||||||
|
|
||||||
config["suffix"] = os.environ.get("DOCKER_AUTOTAG_SUFFIX", None)
|
config["suffix"] = os.environ.get("DOCKER_AUTOTAG_SUFFIX", None)
|
||||||
|
config["suffix_strict"] = to_bool(os.environ.get("DOCKER_AUTOTAG_SUFFIX_STRICT", False))
|
||||||
config["version"] = os.environ.get("DOCKER_AUTOTAG_VERSION", None)
|
config["version"] = os.environ.get("DOCKER_AUTOTAG_VERSION", None)
|
||||||
config["extra"] = os.environ.get("DOCKER_AUTOTAG_EXTRA_TAGS", None)
|
config["extra"] = os.environ.get("DOCKER_AUTOTAG_EXTRA_TAGS", None)
|
||||||
config["force_latest"] = to_bool(os.environ.get("DOCKER_AUTOTAG_FORCE_LATEST", False))
|
config["force_latest"] = to_bool(os.environ.get("DOCKER_AUTOTAG_FORCE_LATEST", False))
|
||||||
|
@ -58,16 +55,19 @@ class Autotag:
|
||||||
return tags + e
|
return tags + e
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _tag_suffix(tags, suffix):
|
def _tag_suffix(tags, suffix, suffix_strict):
|
||||||
if not suffix:
|
if not suffix:
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
res = copy.deepcopy(tags)
|
res = []
|
||||||
|
if not suffix_strict:
|
||||||
|
res = copy.deepcopy(tags)
|
||||||
|
|
||||||
for t in tags:
|
for t in tags:
|
||||||
if t == "latest":
|
if t == "latest":
|
||||||
res.append(suffix)
|
res.append(suffix)
|
||||||
else:
|
else:
|
||||||
res.append("{}-{}".format(t, suffix))
|
res.append(f"{t}-{suffix}")
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -90,25 +90,23 @@ class Autotag:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
version = semantic_version.Version.coerce(ref)
|
version = semantic_version.Version.coerce(ref)
|
||||||
except Exception: # noqa:B902
|
except Exception: # noqa: BLE001
|
||||||
return default
|
return default
|
||||||
except Exception: # noqa:B902
|
except Exception: # noqa: BLE001
|
||||||
return default
|
return default
|
||||||
|
|
||||||
if version.prerelease:
|
if version.prerelease:
|
||||||
tags.append(
|
tags.append(
|
||||||
"{}.{}.{}-{}".format(
|
f"{version.major}.{version.minor}.{version.patch}-{to_prerelease(version.prerelease)}"
|
||||||
version.major, version.minor, version.patch, to_prerelease(version.prerelease)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
if not ignore_pre:
|
if not ignore_pre:
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
tags.append("{}.{}".format(version.major, version.minor))
|
tags.append(f"{version.major}.{version.minor}")
|
||||||
tags.append("{}.{}.{}".format(version.major, version.minor, version.patch))
|
tags.append(f"{version.major}.{version.minor}.{version.patch}")
|
||||||
|
|
||||||
if version.major > 0:
|
if version.major > 0:
|
||||||
tags.append("{}".format(version.major))
|
tags.append(f"{version.major}")
|
||||||
|
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
|
@ -116,17 +114,18 @@ class Autotag:
|
||||||
config = self.config
|
config = self.config
|
||||||
|
|
||||||
v = self._default_tags(config["version"], config["ignore_pre"], config["force_latest"])
|
v = self._default_tags(config["version"], config["ignore_pre"], config["force_latest"])
|
||||||
v = self._tag_suffix(v, config["suffix"])
|
v = self._tag_suffix(v, config["suffix"], config["suffix_strict"])
|
||||||
v = self._tag_extra(v, config["extra"])
|
v = self._tag_extra(v, config["extra"])
|
||||||
|
|
||||||
if config["file"]:
|
try:
|
||||||
try:
|
if config["file"]:
|
||||||
with open(config["file"], "w") as f:
|
with open(config["file"], "w") as f:
|
||||||
f.write(",".join(v))
|
f.write(",".join(v))
|
||||||
except IOError as e:
|
else:
|
||||||
self.logger.error("Unable to write file: {}".format(str(e)))
|
sys.stdout.write(",".join(v))
|
||||||
|
sys.stdout.write("\n")
|
||||||
print(",".join(v))
|
except OSError as e:
|
||||||
|
self.logger.error(f"Unable to write file: {e!s}")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -7,11 +7,10 @@ import sys
|
||||||
import colorama
|
import colorama
|
||||||
from pythonjsonlogger import jsonlogger
|
from pythonjsonlogger import jsonlogger
|
||||||
|
|
||||||
from dockerautotag.utils import Singleton
|
from dockerautotag.utils import Singleton, to_bool
|
||||||
from dockerautotag.utils import to_bool
|
|
||||||
|
|
||||||
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
||||||
JSON_FORMAT = "(asctime) (levelname) (message)"
|
JSON_FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
||||||
|
|
||||||
|
|
||||||
def _should_do_markup():
|
def _should_do_markup():
|
||||||
|
@ -25,7 +24,7 @@ def _should_do_markup():
|
||||||
colorama.init(autoreset=True, strip=not _should_do_markup())
|
colorama.init(autoreset=True, strip=not _should_do_markup())
|
||||||
|
|
||||||
|
|
||||||
class LogFilter(object):
|
class LogFilter:
|
||||||
"""A custom log filter which excludes log messages above the logged level."""
|
"""A custom log filter which excludes log messages above the logged level."""
|
||||||
|
|
||||||
def __init__(self, level):
|
def __init__(self, level):
|
||||||
|
@ -46,15 +45,15 @@ class LogFilter(object):
|
||||||
class MultilineFormatter(logging.Formatter):
|
class MultilineFormatter(logging.Formatter):
|
||||||
"""Logging Formatter to reset color after newline characters."""
|
"""Logging Formatter to reset color after newline characters."""
|
||||||
|
|
||||||
def format(self, record): # noqa
|
def format(self, record):
|
||||||
record.msg = record.msg.replace("\n", "\n{}... ".format(colorama.Style.RESET_ALL))
|
record.msg = record.msg.replace("\n", f"\n{colorama.Style.RESET_ALL}... ")
|
||||||
return logging.Formatter.format(self, record)
|
return logging.Formatter.format(self, record)
|
||||||
|
|
||||||
|
|
||||||
class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
||||||
"""Logging Formatter to remove newline characters."""
|
"""Logging Formatter to remove newline characters."""
|
||||||
|
|
||||||
def format(self, record): # noqa
|
def format(self, record):
|
||||||
record.msg = record.msg.replace("\n", " ")
|
record.msg = record.msg.replace("\n", " ")
|
||||||
return jsonlogger.JsonFormatter.format(self, record)
|
return jsonlogger.JsonFormatter.format(self, record)
|
||||||
|
|
||||||
|
@ -62,11 +61,11 @@ class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
||||||
class Log:
|
class Log:
|
||||||
"""Base logging object."""
|
"""Base logging object."""
|
||||||
|
|
||||||
def __init__(self, level=logging.WARN, name="ansibledoctor", json=False):
|
def __init__(self, level=logging.WARNING, name="ansibledoctor", json=False):
|
||||||
self.logger = logging.getLogger(name)
|
self.logger = logging.getLogger(name)
|
||||||
self.logger.setLevel(level)
|
self.logger.setLevel(level)
|
||||||
self.logger.addHandler(self._get_error_handler(json=json))
|
self.logger.addHandler(self._get_error_handler(json=json))
|
||||||
self.logger.addHandler(self._get_warn_handler(json=json))
|
self.logger.addHandler(self._get_warning_handler(json=json))
|
||||||
self.logger.addHandler(self._get_info_handler(json=json))
|
self.logger.addHandler(self._get_info_handler(json=json))
|
||||||
self.logger.addHandler(self._get_critical_handler(json=json))
|
self.logger.addHandler(self._get_critical_handler(json=json))
|
||||||
self.logger.addHandler(self._get_debug_handler(json=json))
|
self.logger.addHandler(self._get_debug_handler(json=json))
|
||||||
|
@ -87,13 +86,13 @@ class Log:
|
||||||
|
|
||||||
return handler
|
return handler
|
||||||
|
|
||||||
def _get_warn_handler(self, json=False):
|
def _get_warning_handler(self, json=False):
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
handler.setLevel(logging.WARN)
|
handler.setLevel(logging.WARNING)
|
||||||
handler.addFilter(LogFilter(logging.WARN))
|
handler.addFilter(LogFilter(logging.WARNING))
|
||||||
handler.setFormatter(
|
handler.setFormatter(
|
||||||
MultilineFormatter(
|
MultilineFormatter(
|
||||||
self.warn(CONSOLE_FORMAT.format(colorama.Fore.YELLOW, colorama.Style.RESET_ALL))
|
self.warning(CONSOLE_FORMAT.format(colorama.Fore.YELLOW, colorama.Style.RESET_ALL))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -162,8 +161,8 @@ class Log:
|
||||||
"""Format error messages and return string."""
|
"""Format error messages and return string."""
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def warn(self, msg):
|
def warning(self, msg):
|
||||||
"""Format warn messages and return string."""
|
"""Format warning messages and return string."""
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def info(self, msg):
|
def info(self, msg):
|
||||||
|
@ -179,7 +178,7 @@ class Log:
|
||||||
:returns: string
|
:returns: string
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return "{}{}{}".format(color, msg, colorama.Style.RESET_ALL)
|
return f"{color}{msg}{colorama.Style.RESET_ALL}"
|
||||||
|
|
||||||
def sysexit(self, code=1):
|
def sysexit(self, code=1):
|
||||||
sys.exit(code)
|
sys.exit(code)
|
||||||
|
|
|
@ -1,13 +1,38 @@
|
||||||
"""Global utility methods and classes."""
|
"""Global utility methods and classes."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from distutils.util import strtobool
|
|
||||||
|
|
||||||
|
|
||||||
def normalize_path(path):
|
def normalize_path(path):
|
||||||
if path:
|
if path:
|
||||||
return os.path.abspath(os.path.expanduser(os.path.expandvars(path)))
|
return os.path.abspath(os.path.expanduser(os.path.expandvars(path)))
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def strtobool(value):
|
||||||
|
"""Convert a string representation of truth to true or false."""
|
||||||
|
|
||||||
|
_map = {
|
||||||
|
"y": True,
|
||||||
|
"yes": True,
|
||||||
|
"t": True,
|
||||||
|
"true": True,
|
||||||
|
"on": True,
|
||||||
|
"1": True,
|
||||||
|
"n": False,
|
||||||
|
"no": False,
|
||||||
|
"f": False,
|
||||||
|
"false": False,
|
||||||
|
"off": False,
|
||||||
|
"0": False,
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
return _map[str(value).lower()]
|
||||||
|
except KeyError as err:
|
||||||
|
raise ValueError(f'"{value}" is not a valid bool value') from err
|
||||||
|
|
||||||
|
|
||||||
def to_bool(string):
|
def to_bool(string):
|
||||||
return bool(strtobool(str(string)))
|
return bool(strtobool(str(string)))
|
||||||
|
@ -15,13 +40,12 @@ def to_bool(string):
|
||||||
|
|
||||||
def trim_prefix(text, prefix):
|
def trim_prefix(text, prefix):
|
||||||
if text.startswith(prefix):
|
if text.startswith(prefix):
|
||||||
return text[len(prefix):]
|
return text[len(prefix) :]
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
def to_prerelease(tup):
|
def to_prerelease(tup):
|
||||||
res = "".join(tup)
|
return ".".join(tup)
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
class Singleton(type):
|
class Singleton(type):
|
||||||
|
@ -31,5 +55,5 @@ class Singleton(type):
|
||||||
|
|
||||||
def __call__(cls, *args, **kwargs):
|
def __call__(cls, *args, **kwargs):
|
||||||
if cls not in cls._instances:
|
if cls not in cls._instances:
|
||||||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
cls._instances[cls] = super().__call__(*args, **kwargs)
|
||||||
return cls._instances[cls]
|
return cls._instances[cls]
|
||||||
|
|
1047
poetry.lock
generated
1047
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
126
pyproject.toml
126
pyproject.toml
|
@ -10,75 +10,52 @@ classifiers = [
|
||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Operating System :: POSIX",
|
"Operating System :: POSIX",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
"Topic :: Software Development",
|
"Topic :: Software Development",
|
||||||
]
|
]
|
||||||
description = "Creates a list of docker tags from a given version string."
|
description = "Creates a list of docker tags from a given version string."
|
||||||
documentation = "https://github.com/thegeeklab/docker-autotag/"
|
documentation = "https://github.com/thegeeklab/docker-autotag/"
|
||||||
homepage = "https://github.com/thegeeklab/docker-autotag/"
|
homepage = "https://github.com/thegeeklab/docker-autotag/"
|
||||||
include = [
|
include = ["LICENSE"]
|
||||||
"LICENSE",
|
|
||||||
]
|
|
||||||
keywords = ["docker", "versioning", "automation", "ci"]
|
keywords = ["docker", "versioning", "automation", "ci"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "docker-autotag"
|
name = "docker-autotag"
|
||||||
packages = [
|
packages = [{ include = "dockerautotag" }]
|
||||||
{include = "dockerautotag"},
|
|
||||||
]
|
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/thegeeklab/docker-autotag/"
|
repository = "https://github.com/thegeeklab/docker-autotag/"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
colorama = "0.4.4"
|
colorama = "0.4.6"
|
||||||
python = "^3.7.0"
|
python = "^3.8.0"
|
||||||
python-json-logger = "2.0.2"
|
python-json-logger = "2.0.7"
|
||||||
semantic-version = "2.8.5"
|
semantic-version = "2.10.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
|
||||||
bandit = "1.7.0"
|
|
||||||
flake8 = "3.9.2"
|
|
||||||
flake8-blind-except = "0.2.0"
|
|
||||||
flake8-builtins = "1.5.3"
|
|
||||||
flake8-docstrings = "1.6.0"
|
|
||||||
flake8-eradicate = "1.1.0"
|
|
||||||
flake8-isort = "4.0.0"
|
|
||||||
flake8-logging-format = "0.6.0"
|
|
||||||
flake8-pep3101 = "1.3.0"
|
|
||||||
flake8-polyfill = "1.0.2"
|
|
||||||
flake8-quotes = "3.3.0"
|
|
||||||
pdoc3 = "0.10.0"
|
|
||||||
pep8-naming = "0.12.1"
|
|
||||||
pydocstyle = "6.1.1"
|
|
||||||
pytest = "6.2.5"
|
|
||||||
pytest-cov = "2.12.1"
|
|
||||||
pytest-mock = "3.6.1"
|
|
||||||
requests-mock = "1.9.3"
|
|
||||||
yapf = "0.31.0"
|
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
docker-autotag = "dockerautotag.cli:main"
|
docker-autotag = "dockerautotag.cli:main"
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
ruff = "0.4.10"
|
||||||
|
pytest = "8.2.2"
|
||||||
|
pytest-mock = "3.14.0"
|
||||||
|
pytest-cov = "5.0.0"
|
||||||
|
toml = "0.10.2"
|
||||||
|
|
||||||
[tool.poetry-dynamic-versioning]
|
[tool.poetry-dynamic-versioning]
|
||||||
enable = true
|
enable = true
|
||||||
style = "semver"
|
style = "semver"
|
||||||
vcs = "git"
|
vcs = "git"
|
||||||
|
|
||||||
[tool.isort]
|
|
||||||
default_section = "THIRDPARTY"
|
|
||||||
force_single_line = true
|
|
||||||
line_length = 99
|
|
||||||
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
|
|
||||||
skip_glob = ["**/.env*", "**/env/*", "**/.venv/*", "**/docs/*"]
|
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "dockerautotag --cov=dockerautotag --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail"
|
addopts = "dockerautotag --cov=dockerautotag --cov-report=xml:coverage.xml --cov-report=term --no-cov-on-fail"
|
||||||
filterwarnings = [
|
filterwarnings = [
|
||||||
"ignore::FutureWarning",
|
"ignore::FutureWarning",
|
||||||
"ignore:.*collections.*:DeprecationWarning",
|
"ignore::DeprecationWarning",
|
||||||
"ignore:.*pep8.*:FutureWarning",
|
"ignore:.*pep8.*:FutureWarning",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -86,5 +63,70 @@ filterwarnings = [
|
||||||
omit = ["**/test/*"]
|
omit = ["**/test/*"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry_dynamic_versioning.backend"
|
||||||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
exclude = [
|
||||||
|
".git",
|
||||||
|
"__pycache__",
|
||||||
|
"build",
|
||||||
|
"dist",
|
||||||
|
"test",
|
||||||
|
"*.pyc",
|
||||||
|
"*.egg-info",
|
||||||
|
".cache",
|
||||||
|
".eggs",
|
||||||
|
"env*",
|
||||||
|
]
|
||||||
|
|
||||||
|
line-length = 99
|
||||||
|
indent-width = 4
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
# Explanation of errors
|
||||||
|
#
|
||||||
|
# D102: Missing docstring in public method
|
||||||
|
# D103: Missing docstring in public function
|
||||||
|
# D105: Missing docstring in magic method
|
||||||
|
# D107: Missing docstring in __init__
|
||||||
|
# D202: No blank lines allowed after function docstring
|
||||||
|
# D203: One blank line required before class docstring
|
||||||
|
# D212: Multi-line docstring summary should start at the first line
|
||||||
|
ignore = [
|
||||||
|
"D102",
|
||||||
|
"D103",
|
||||||
|
"D105",
|
||||||
|
"D107",
|
||||||
|
"D202",
|
||||||
|
"D203",
|
||||||
|
"D212",
|
||||||
|
"UP038",
|
||||||
|
"RUF012",
|
||||||
|
]
|
||||||
|
select = [
|
||||||
|
"D",
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"Q",
|
||||||
|
"W",
|
||||||
|
"I",
|
||||||
|
"S",
|
||||||
|
"BLE",
|
||||||
|
"N",
|
||||||
|
"UP",
|
||||||
|
"B",
|
||||||
|
"A",
|
||||||
|
"C4",
|
||||||
|
"T20",
|
||||||
|
"SIM",
|
||||||
|
"RET",
|
||||||
|
"ARG",
|
||||||
|
"ERA",
|
||||||
|
"RUF",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.ruff.format]
|
||||||
|
quote-style = "double"
|
||||||
|
indent-style = "space"
|
||||||
|
line-ending = "lf"
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["github>thegeeklab/renovate-presets"]
|
"extends": ["github>thegeeklab/renovate-presets"],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchManagers": ["woodpecker"],
|
||||||
|
"matchFileNames": [".woodpecker/test.yml"],
|
||||||
|
"matchPackageNames": ["docker.io/library/python"],
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
20
setup.cfg
20
setup.cfg
|
@ -1,20 +0,0 @@
|
||||||
[flake8]
|
|
||||||
# Explanation of errors
|
|
||||||
#
|
|
||||||
# D102: Missing docstring in public method
|
|
||||||
# D103: Missing docstring in public function
|
|
||||||
# D105: Missing docstring in magic method
|
|
||||||
# D107: Missing docstring in __init__
|
|
||||||
# D202: No blank lines allowed after function docstring
|
|
||||||
# W503:Line break occurred before a binary operator
|
|
||||||
ignore = D102, D103, D105, D107, D202, W503
|
|
||||||
max-line-length = 99
|
|
||||||
inline-quotes = double
|
|
||||||
exclude = .git, __pycache__, build, dist, test, *.pyc, *.egg-info, .cache, .eggs, env*
|
|
||||||
|
|
||||||
[yapf]
|
|
||||||
based_on_style = google
|
|
||||||
column_limit = 99
|
|
||||||
dedent_closing_brackets = true
|
|
||||||
coalesce_brackets = true
|
|
||||||
split_before_logical_operator = true
|
|
Loading…
Reference in New Issue
Block a user