From 00b27a9306ffc2aef0b3e15ff8d29dacdbe37f37 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 25 Sep 2020 19:48:40 +0200 Subject: [PATCH] migrate to thegeeklab namespace --- .drone.jsonnet | 85 +++++++++++++++---- .drone.yml | 141 ++++++++++++++++++++++++++------ LICENSE | 2 +- README.md | 18 ++-- bin/docker-tidy | 7 -- Dockerfile => docker/Dockerfile | 4 +- docker/manifest-quay.tmpl | 24 ++++++ docker/manifest.tmpl | 24 ++++++ dockertidy/__init__.py | 4 +- docs/config.yaml | 2 +- docs/content/_index.md | 10 ++- docs/content/setup/_index.md | 4 +- docs/data/menu/more.yml | 4 +- manifest.tmpl | 24 ------ 14 files changed, 261 insertions(+), 92 deletions(-) delete mode 100755 bin/docker-tidy rename Dockerfile => docker/Dockerfile (81%) create mode 100644 docker/manifest-quay.tmpl create mode 100644 docker/manifest.tmpl delete mode 100644 manifest.tmpl diff --git a/.drone.jsonnet b/.drone.jsonnet index 9031703..cc8ea0b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -227,7 +227,7 @@ local PipelineBuildContainer(arch='amd64') = { settings: { dry_run: true, dockerfile: 'Dockerfile', - repo: 'xoxys/${DRONE_REPO_NAME}', + repo: 'thegeeklab/${DRONE_REPO_NAME}', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, }, @@ -236,19 +236,37 @@ local PipelineBuildContainer(arch='amd64') = { }, }, { - name: 'publish', + name: 'publish-dockerhub', image: 'plugins/docker:18-linux-' + arch, settings: { auto_tag: true, auto_tag_suffix: arch, - dockerfile: 'Dockerfile', - repo: 'xoxys/${DRONE_REPO_NAME}', + dockerfile: 'docker/Dockerfile.' + arch, + repo: 'thegeeklab/${DRONE_REPO_NAME}', username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, }, when: { ref: ['refs/heads/master', 'refs/tags/**'], }, + depends_on: ['dryrun'], + }, + { + name: 'publish-quay', + image: 'plugins/docker:18-linux-' + arch, + 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/master', 'refs/tags/**'], + }, + depends_on: ['dryrun'], }, ], depends_on: [ @@ -311,7 +329,7 @@ local PipelineDocs = { }, { name: 'link-validation', - image: 'xoxys/link-validator', + image: 'thegeeklab/link-validator', commands: [ 'link-validator -ro', ], @@ -375,25 +393,62 @@ local PipelineNotifications = { steps: [ { image: 'plugins/manifest', - name: 'manifest', + name: 'manifest-dockerhub', settings: { ignore_missing: true, auto_tag: true, username: { from_secret: 'docker_username' }, password: { from_secret: 'docker_password' }, - spec: 'manifest.tmpl', + spec: 'docker/manifest.tmpl', + }, + when: { + status: ['success'], }, }, { - name: 'readme', - image: 'sheogorath/readme-to-dockerhub', + 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', + image: 'chko/docker-pushrm:1', environment: { - DOCKERHUB_USERNAME: { from_secret: 'docker_username' }, - DOCKERHUB_PASSWORD: { from_secret: 'docker_password' }, - DOCKERHUB_REPO_PREFIX: 'xoxys', - DOCKERHUB_REPO_NAME: '${DRONE_REPO_NAME}', - README_PATH: 'README.md', - SHORT_DESCRIPTION: 'docker-tidy - Keep docker hosts tidy', + DOCKER_PASS: { + from_secret: 'docker_password', + }, + DOCKER_USER: { + from_secret: 'docker_username', + }, + PUSHRM_FILE: 'README.md', + PUSHRM_SHORT: 'Drone plugin to add comments to GitHub Issues/PRs', + PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}', + }, + when: { + status: ['success'], + }, + }, + { + name: 'pushrm-quay', + 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'], }, }, { diff --git a/.drone.yml b/.drone.yml index 1f6e20e..a348edb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -251,28 +251,49 @@ steps: dry_run: true password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/pull/** -- name: publish +- name: publish-dockerhub image: plugins/docker:18-linux-amd64 settings: auto_tag: true auto_tag_suffix: amd64 - dockerfile: Dockerfile + dockerfile: docker/Dockerfile.amd64 password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/heads/master - refs/tags/** + depends_on: + - dryrun + +- name: publish-quay + image: plugins/docker:18-linux-amd64 + 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/master + - refs/tags/** + depends_on: + - dryrun trigger: ref: @@ -306,28 +327,49 @@ steps: dry_run: true password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/pull/** -- name: publish +- name: publish-dockerhub image: plugins/docker:18-linux-arm64 settings: auto_tag: true auto_tag_suffix: arm64 - dockerfile: Dockerfile + dockerfile: docker/Dockerfile.arm64 password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/heads/master - refs/tags/** + depends_on: + - dryrun + +- name: publish-quay + image: plugins/docker:18-linux-arm64 + 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/master + - refs/tags/** + depends_on: + - dryrun trigger: ref: @@ -361,28 +403,49 @@ steps: dry_run: true password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/pull/** -- name: publish +- name: publish-dockerhub image: plugins/docker:18-linux-arm settings: auto_tag: true auto_tag_suffix: arm - dockerfile: Dockerfile + dockerfile: docker/Dockerfile.arm password: from_secret: docker_password - repo: xoxys/${DRONE_REPO_NAME} + repo: thegeeklab/${DRONE_REPO_NAME} username: from_secret: docker_username when: ref: - refs/heads/master - refs/tags/** + depends_on: + - dryrun + +- name: publish-quay + image: plugins/docker:18-linux-arm + 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/master + - refs/tags/** + depends_on: + - dryrun trigger: ref: @@ -435,7 +498,7 @@ steps: - hugo-official -s docs/ -b http://localhost/ - name: link-validation - image: xoxys/link-validator + image: thegeeklab/link-validator commands: - link-validator -ro environment: @@ -490,28 +553,58 @@ platform: arch: amd64 steps: -- name: manifest +- name: manifest-dockerhub image: plugins/manifest settings: auto_tag: true ignore_missing: true password: from_secret: docker_password - spec: manifest.tmpl + spec: docker/manifest.tmpl username: from_secret: docker_username + when: + status: + - success -- name: readme - image: sheogorath/readme-to-dockerhub +- 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 + image: chko/docker-pushrm:1 environment: - DOCKERHUB_PASSWORD: + DOCKER_PASS: from_secret: docker_password - DOCKERHUB_REPO_NAME: ${DRONE_REPO_NAME} - DOCKERHUB_REPO_PREFIX: xoxys - DOCKERHUB_USERNAME: + DOCKER_USER: from_secret: docker_username - README_PATH: README.md - SHORT_DESCRIPTION: docker-tidy - Keep docker hosts tidy + PUSHRM_FILE: README.md + PUSHRM_SHORT: Drone plugin to add comments to GitHub Issues/PRs + PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME} + when: + status: + - success + +- name: pushrm-quay + 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: plugins/matrix @@ -543,6 +636,6 @@ depends_on: --- kind: signature -hmac: d01e452cbf36353f65131c9ccc10112e4d22bc798f06d44f89acdd203de0bb17 +hmac: 105ae48737c04a5781db332dea95028cd19abb74f00add8fb65730891a18e6bd ... diff --git a/LICENSE b/LICENSE index fb2b81f..c3ae789 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Robert Kaussow + Copyright 2020 Robert Kaussow Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 830ec64..e97dec4 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,23 @@ # docker-tidy -[![Build Status](https://img.shields.io/drone/build/xoxys/docker-tidy?logo=drone)](https://cloud.drone.io/xoxys/docker-tidy) -[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/xoxys/docker-tidy) +[![Build Status](https://img.shields.io/drone/build/thegeeklab/docker-tidy?logo=drone)](https://cloud.drone.io/thegeeklab/docker-tidy) +[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy) [![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) -[![Codecov](https://img.shields.io/codecov/c/github/xoxys/docker-tidy)](https://codecov.io/gh/xoxys/docker-tidy) -[![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](LICENSE) +[![Codecov](https://img.shields.io/codecov/c/github/thegeeklab/docker-tidy)](https://codecov.io/gh/thegeeklab/docker-tidy) +[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors) +[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/master/LICENSE) This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy. You can find the full documentation at [https://docker-tidy.geekdocs.de](https://docker-tidy.geekdocs.de/). -## License +## Contributors -This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. +Special thanks goes to all [contributors](https://github.com/thegeeklab/docker-tidy/graphs/contributors). -## Maintainers and Contributors +## License -[Robert Kaussow](https://github.com/xoxys) +This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/docker-tidy/blob/master/LICENSE) file for details. diff --git a/bin/docker-tidy b/bin/docker-tidy deleted file mode 100755 index 10e597a..0000000 --- a/bin/docker-tidy +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -import sys - -import dockertidy.__main__ - -sys.exit(dockertidy.__main__.main()) diff --git a/Dockerfile b/docker/Dockerfile similarity index 81% rename from Dockerfile rename to docker/Dockerfile index 3346292..3a3bb8b 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,8 @@ FROM python:3.8-alpine -LABEL maintainer="Robert Kaussow " \ +LABEL maintainer="Robert Kaussow " \ org.label-schema.name="docker-tidy" \ - org.label-schema.vcs-url="https://github.com/xoxys/docker-tidy" \ + org.label-schema.vcs-url="https://github.com/thegeeklab/docker-tidy" \ org.label-schema.vendor="Robert Kaussow" \ org.label-schema.schema-version="1.0" diff --git a/docker/manifest-quay.tmpl b/docker/manifest-quay.tmpl new file mode 100644 index 0000000..be91075 --- /dev/null +++ b/docker/manifest-quay.tmpl @@ -0,0 +1,24 @@ +image: quay.io/thegeeklab/docker-tidy:{{#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-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64 + platform: + architecture: amd64 + os: linux + + - image: quay.io/thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + + - image: quay.io/thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl new file mode 100644 index 0000000..9c918bf --- /dev/null +++ b/docker/manifest.tmpl @@ -0,0 +1,24 @@ +image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64 + platform: + architecture: amd64 + os: linux + + - image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + + - image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/dockertidy/__init__.py b/dockertidy/__init__.py index 16fbfd8..631a08c 100644 --- a/dockertidy/__init__.py +++ b/dockertidy/__init__.py @@ -10,6 +10,6 @@ __author__ = "Robert Kaussow" __project__ = "docker-tidy" __license__ = "Apache-2.0" __maintainer__ = "Robert Kaussow" -__email__ = "mail@geeklabor.de" -__url__ = "https://github.com/xoxys/docker-tidy" +__email__ = "mail@thegeeklab.de" +__url__ = "https://github.com/thegeeklab/docker-tidy" __version__ = metadata.version("docker-tidy") diff --git a/docs/config.yaml b/docs/config.yaml index 0e9b891..2563442 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -21,7 +21,7 @@ params: geekdocMenuBundle: true geekdocToC: 3 - geekdocRepo: https://github.com/xoxys/docker-tidy + geekdocRepo: https://github.com/thegeeklab/docker-tidy geekdocEditPath: edit/master/docs/content geekdocDateFormat: "Jan 2, 2006" diff --git a/docs/content/_index.md b/docs/content/_index.md index 3e12678..7e41dba 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -2,12 +2,14 @@ title: Documentation --- -[![Build Status](https://img.shields.io/drone/build/xoxys/docker-tidy?logo=drone)](https://cloud.drone.io/xoxys/docker-tidy) -[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/xoxys/docker-tidy) +[![Build Status](https://img.shields.io/drone/build/thegeeklab/docker-tidy?logo=drone)](https://cloud.drone.io/thegeeklab/docker-tidy) +[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy) [![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) -[![Codecov](https://img.shields.io/codecov/c/github/xoxys/docker-tidy)](https://codecov.io/gh/xoxys/docker-tidy) -[![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](https://github.com/xoxys/docker-tidy/blob/master/LICENSE) +[![Codecov](https://img.shields.io/codecov/c/github/thegeeklab/docker-tidy)](https://codecov.io/gh/thegeeklab/docker-tidy) +[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors) +[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/master/LICENSE) This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy. diff --git a/docs/content/setup/_index.md b/docs/content/setup/_index.md index b8354a8..a8abb2e 100644 --- a/docs/content/setup/_index.md +++ b/docs/content/setup/_index.md @@ -19,7 +19,7 @@ $ pip install docker-tidy --user $ sudo pip install docker-tidy # From Wheel file -$ pip install https://github.com/xoxys/docker-tidy/releases/download/v0.1.0/docker_tidy-0.1.0-py2.py3-none-any.whl +$ pip install https://github.com/thegeeklab/docker-tidy/releases/download/v0.1.0/docker_tidy-0.1.0-py2.py3-none-any.whl {{< /highlight >}} @@ -38,7 +38,7 @@ docker run \ -e TIDY_GC_MAX_CONTAINER_AGE="3 days ago" \ -e TIDY_GC_MAX_IMAGE_AGE="5 days ago" \ -v /var/run/docker.sock:/var/run/docker.sock \ - xoxys/docker-tidy + thegeeklab/docker-tidy {{< /highlight >}} diff --git a/docs/data/menu/more.yml b/docs/data/menu/more.yml index 23b0129..9a8f2ab 100644 --- a/docs/data/menu/more.yml +++ b/docs/data/menu/more.yml @@ -1,10 +1,10 @@ --- more: - name: Releases - ref: "https://github.com/xoxys/docker-tidy/releases" + ref: "https://github.com/thegeeklab/docker-tidy/releases" external: true icon: "download" - name: "View Source" - ref: "https://github.com/xoxys/docker-tidy" + ref: "https://github.com/thegeeklab/docker-tidy" external: true icon: "github" diff --git a/manifest.tmpl b/manifest.tmpl deleted file mode 100644 index d72572a..0000000 --- a/manifest.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -image: xoxys/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} -{{#if build.tags}} -tags: -{{#each build.tags}} - - {{this}} -{{/each}} -{{/if}} -manifests: - - image: xoxys/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64 - platform: - architecture: amd64 - os: linux - - - image: xoxys/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64 - platform: - architecture: arm64 - os: linux - variant: v8 - - - image: xoxys/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm - platform: - architecture: arm - os: linux - variant: v7