From 9ea4b33577c58f8fa254053e419a3c58ca9ba086 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 21 Dec 2021 10:29:13 +0100 Subject: [PATCH] chore: end of the year maintenance --- .drone.jsonnet | 259 ++++++++++++++++++++++++------------------------ .drone.yml | 204 +++++++++++++++++++------------------- .prettierignore | 3 + LICENSE | 20 +++- 4 files changed, 250 insertions(+), 236 deletions(-) create mode 100644 .prettierignore diff --git a/.drone.jsonnet b/.drone.jsonnet index 7fde47b..54c0a83 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,150 +1,149 @@ -local PythonVersion(pyversion="3.5") = { - name: "python" + std.strReplace(pyversion, '.', '') + "-pytest", - image: "python:" + pyversion, - pull: "always", - environment: { - PY_COLORS: 1 - }, - commands: [ - "pip install -r test-requirements.txt -qq", - "pip install -qq .", - "drone-cleanup-agents --help", - ], - depends_on: [ - "clone", - ], +local PythonVersion(pyversion='3.5') = { + name: 'python' + std.strReplace(pyversion, '.', '') + '-pytest', + image: 'python:' + pyversion, + pull: 'always', + environment: { + PY_COLORS: 1, + }, + commands: [ + 'pip install -r test-requirements.txt -qq', + 'pip install -qq .', + 'drone-cleanup-agents --help', + ], + depends_on: [ + 'clone', + ], }; local PipelineLint = { - kind: "pipeline", - name: "lint", - platform: { - os: "linux", - arch: "amd64", - }, - steps: [ - { - name: "flake8", - image: "python:3.7", - pull: "always", - environment: { - PY_COLORS: 1 - }, - commands: [ - "pip install -r test-requirements.txt -qq", - "pip install -qq .", - "flake8 ./cleanupagents", - ], - }, - ], - trigger: { - ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"], + kind: 'pipeline', + name: 'lint', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'flake8', + image: 'python:3.7', + pull: 'always', + environment: { + PY_COLORS: 1, + }, + commands: [ + 'pip install -r test-requirements.txt -qq', + 'pip install -qq .', + 'flake8 ./cleanupagents', + ], }, + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, }; local PipelineTest = { - kind: "pipeline", - name: "test", - platform: { - os: "linux", - arch: "amd64", - }, - steps: [ - PythonVersion(pyversion="3.5"), - PythonVersion(pyversion="3.6"), - PythonVersion(pyversion="3.7"), - PythonVersion(pyversion="3.8"), - ], - trigger: { - ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"], - }, - depends_on: [ - "lint", - ], + kind: 'pipeline', + name: 'test', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + PythonVersion(pyversion='3.5'), + PythonVersion(pyversion='3.6'), + PythonVersion(pyversion='3.7'), + PythonVersion(pyversion='3.8'), + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, + depends_on: [ + 'lint', + ], }; local PipelineSecurity = { - kind: "pipeline", - name: "security", - platform: { - os: "linux", - arch: "amd64", - }, - steps: [ - { - name: "bandit", - image: "python:3.7", - pull: "always", - environment: { - PY_COLORS: 1 - }, - commands: [ - "pip install -r test-requirements.txt -qq", - "pip install -qq .", - "bandit -r ./cleanupagents -x ./cleanupagents/tests", - ], - }, - ], - depends_on: [ - "test", - ], - trigger: { - ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"], + kind: 'pipeline', + name: 'security', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'bandit', + image: 'python:3.7', + pull: 'always', + environment: { + PY_COLORS: 1, + }, + commands: [ + 'pip install -r test-requirements.txt -qq', + 'pip install -qq .', + 'bandit -r ./cleanupagents -x ./cleanupagents/tests', + ], }, + ], + depends_on: [ + 'test', + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, }; local PipelineBuild = { - kind: "pipeline", - name: "build", - platform: { - os: "linux", - arch: "amd64", + kind: 'pipeline', + name: 'build', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'build', + image: 'python:3.7', + pull: 'always', + commands: [ + 'python setup.py sdist bdist_wheel', + ], }, - steps: [ - { - name: "build", - image: "python:3.7", - pull: "always", - commands: [ - "python setup.py sdist bdist_wheel", - ] - }, - { - name: "checksum", - image: "alpine", - pull: "always", - commands: [ - "cd dist/ && sha256sum * > sha256sum.txt" - ], - }, - { - name: "publish-gitea", - image: "plugins/gitea-release", - pull: "always", - settings: { - base_url: "https://gitea.owncloud.services", - api_key: { "from_secret": "gitea_token"}, - files: ["dist/*", "sha256sum.txt"], - title: "${DRONE_TAG}", - note: "CHANGELOG.md", - }, - when: { - ref: [ "refs/tags/**" ], - }, - }, - ], - depends_on: [ - "security", - ], - trigger: { - ref: ["refs/heads/master", "refs/tags/**", "refs/pull/**"], + { + name: 'checksum', + image: 'alpine', + pull: 'always', + commands: [ + 'cd dist/ && sha256sum * > sha256sum.txt', + ], }, + { + name: 'publish-gitea', + image: 'plugins/gitea-release', + pull: 'always', + settings: { + base_url: 'https://gitea.owncloud.services', + api_key: { from_secret: 'gitea_token' }, + files: ['dist/*', 'sha256sum.txt'], + title: '${DRONE_TAG}', + note: 'CHANGELOG.md', + }, + when: { + ref: ['refs/tags/**'], + }, + }, + ], + depends_on: [ + 'security', + ], + trigger: { + ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + }, }; [ - PipelineLint, - PipelineTest, - PipelineSecurity, - PipelineBuild, + PipelineLint, + PipelineTest, + PipelineSecurity, + PipelineBuild, ] - diff --git a/.drone.yml b/.drone.yml index 0d4ba55..a4f94b2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,21 +7,21 @@ platform: arch: amd64 steps: -- name: flake8 - pull: always - image: python:3.7 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - flake8 ./cleanupagents - environment: - PY_COLORS: 1 + - name: flake8 + pull: always + image: python:3.7 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - flake8 ./cleanupagents + environment: + PY_COLORS: 1 trigger: ref: - - refs/heads/master - - refs/tags/** - - refs/pull/** + - refs/heads/master + - refs/tags/** + - refs/pull/** --- kind: pipeline @@ -32,62 +32,62 @@ platform: arch: amd64 steps: -- name: python35-pytest - pull: always - image: python:3.5 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - drone-cleanup-agents --help - environment: - PY_COLORS: 1 - depends_on: - - clone + - name: python35-pytest + pull: always + image: python:3.5 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - drone-cleanup-agents --help + environment: + PY_COLORS: 1 + depends_on: + - clone -- name: python36-pytest - pull: always - image: python:3.6 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - drone-cleanup-agents --help - environment: - PY_COLORS: 1 - depends_on: - - clone + - name: python36-pytest + pull: always + image: python:3.6 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - drone-cleanup-agents --help + environment: + PY_COLORS: 1 + depends_on: + - clone -- name: python37-pytest - pull: always - image: python:3.7 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - drone-cleanup-agents --help - environment: - PY_COLORS: 1 - depends_on: - - clone + - name: python37-pytest + pull: always + image: python:3.7 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - drone-cleanup-agents --help + environment: + PY_COLORS: 1 + depends_on: + - clone -- name: python38-pytest - pull: always - image: python:3.8 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - drone-cleanup-agents --help - environment: - PY_COLORS: 1 - depends_on: - - clone + - name: python38-pytest + pull: always + image: python:3.8 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - drone-cleanup-agents --help + environment: + PY_COLORS: 1 + depends_on: + - clone trigger: ref: - - refs/heads/master - - refs/tags/** - - refs/pull/** + - refs/heads/master + - refs/tags/** + - refs/pull/** depends_on: -- lint + - lint --- kind: pipeline @@ -98,24 +98,24 @@ platform: arch: amd64 steps: -- name: bandit - pull: always - image: python:3.7 - commands: - - pip install -r test-requirements.txt -qq - - pip install -qq . - - bandit -r ./cleanupagents -x ./cleanupagents/tests - environment: - PY_COLORS: 1 + - name: bandit + pull: always + image: python:3.7 + commands: + - pip install -r test-requirements.txt -qq + - pip install -qq . + - bandit -r ./cleanupagents -x ./cleanupagents/tests + environment: + PY_COLORS: 1 trigger: ref: - - refs/heads/master - - refs/tags/** - - refs/pull/** + - refs/heads/master + - refs/tags/** + - refs/pull/** depends_on: -- test + - test --- kind: pipeline @@ -126,41 +126,41 @@ platform: arch: amd64 steps: -- name: build - pull: always - image: python:3.7 - commands: - - python setup.py sdist bdist_wheel + - name: build + pull: always + image: python:3.7 + commands: + - python setup.py sdist bdist_wheel -- name: checksum - pull: always - image: alpine - commands: - - cd dist/ && sha256sum * > sha256sum.txt + - name: checksum + pull: always + image: alpine + commands: + - cd dist/ && sha256sum * > sha256sum.txt -- name: publish-gitea - pull: always - image: plugins/gitea-release - settings: - api_key: - from_secret: gitea_token - base_url: https://gitea.owncloud.services - files: - - dist/* - - sha256sum.txt - note: CHANGELOG.md - title: ${DRONE_TAG} - when: - ref: - - refs/tags/** + - name: publish-gitea + pull: always + image: plugins/gitea-release + settings: + api_key: + from_secret: gitea_token + base_url: https://gitea.owncloud.services + files: + - dist/* + - sha256sum.txt + note: CHANGELOG.md + title: ${DRONE_TAG} + when: + ref: + - refs/tags/** trigger: ref: - - refs/heads/master - - refs/tags/** - - refs/pull/** + - refs/heads/master + - refs/tags/** + - refs/pull/** depends_on: -- security + - security ... diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..23a4f05 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +.drone.yml +*.tpl.md +LICENSE diff --git a/LICENSE b/LICENSE index 1475a9a..3812eb4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,21 @@ MIT License -Copyright (c) 2019 Robert Kaussow +Copyright (c) 2022 Robert Kaussow -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.