From df7e44732dffeb49ead999fdcf145a70629cdc3d Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 5 Dec 2023 08:20:22 +0100 Subject: [PATCH] chore: add renovate config and update settings --- .drone.star | 283 ------------------------------------------ .github/lock.yml | 9 -- .github/renovate.json | 7 ++ .github/settings.yml | 70 ++++++++--- 4 files changed, 62 insertions(+), 307 deletions(-) delete mode 100644 .drone.star delete mode 100644 .github/lock.yml create mode 100644 .github/renovate.json diff --git a/.drone.star b/.drone.star deleted file mode 100644 index 804e9ac..0000000 --- a/.drone.star +++ /dev/null @@ -1,283 +0,0 @@ -def main(ctx): - config = { - 'title': 'Gitea', - 'image': ctx.repo.name, - 'arches': [ - 'amd64', - 'arm32v6', - 'arm64v8', - ], - 'versions': [ - { - 'path': 'latest', - 'tag': 'latest', - }, - { - 'path': 'v1.12', - 'tag': '1.12', - }, - { - 'path': 'v1.11', - 'tag': '1.11', - }, - { - 'path': 'v1.10', - 'tag': '1.10', - }, - { - 'path': 'v1.9', - 'tag': '1.9', - }, - { - 'path': 'v1.8', - 'tag': '1.8', - }, - ], - 'trigger': [ - - ], - } - - builds = docker(config) - - after = [ - readme(config), - badges(config), - trigger(config), - ] - - for b in builds: - for a in after: - a['depends_on'].append(b['name']) - - return builds + after - -def docker(config): - result = [] - - for version in config['versions']: - versions = [] - - for arch in config['arches']: - - if arch == "amd64": - agent = "amd64" - - if arch == "arm32v6": - agent = "arm" - - if arch == "arm32v7": - agent = "arm" - - if arch == "arm64v8": - agent = "arm64" - - versions.append({ - 'kind': 'pipeline', - 'type': 'docker', - 'name': '%s-%s' % (arch, version['path']), - 'platform': { - 'os': 'linux', - 'arch': agent, - }, - 'steps': [ - { - 'name': 'dryrun', - 'image': 'plugins/docker:latest', - 'pull': 'always', - 'settings': { - 'dry_run': True, - 'dockerfile': '%s/Dockerfile.%s' % (version['path'], arch), - 'tags': '%s-%s' % (version['tag'], arch), - 'repo': 'webhippie/%s' % (config['image']), - 'context': version['path'], - }, - 'when': { - 'ref': { - 'include': [ - 'refs/pull/**', - ], - }, - }, - }, - { - 'name': 'publish', - 'image': 'plugins/docker:latest', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'docker_username', - }, - 'password': { - 'from_secret': 'docker_password', - }, - 'dockerfile': '%s/Dockerfile.%s' % (version['path'], arch), - 'tags': '%s-%s' % (version['tag'], arch), - 'repo': 'webhippie/%s' % (config['image']), - 'context': version['path'], - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - ], - 'depends_on': [], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/pull/**', - ], - }, - }) - - manifest = { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'manifest-%s' % (version['path']), - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'plugins/manifest:latest', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'docker_username', - }, - 'password': { - 'from_secret': 'docker_password', - }, - 'ignore_missing': True, - 'spec': '%s/manifest.tmpl' % (version['path']), - }, - }, - ], - 'depends_on': [], - 'trigger': { - 'ref': [ - 'refs/heads/master', - ], - }, - } - - for version in versions: - manifest['depends_on'].append(version['name']) - - result.extend(versions) - result.append(manifest) - - return result - -def readme(config): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'readme', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'sheogorath/readme-to-dockerhub:latest', - 'pull': 'always', - 'environment': { - 'DOCKERHUB_USERNAME': { - 'from_secret': 'docker_username', - }, - 'DOCKERHUB_PASSWORD': { - 'from_secret': 'docker_password', - }, - 'DOCKERHUB_REPO_PREFIX': 'webhippie', - 'DOCKERHUB_REPO_NAME': config['image'], - 'SHORT_DESCRIPTION': 'Docker images for %s' % (config['title']), - 'README_PATH': 'README.md', - }, - }, - ], - 'depends_on': [], - 'trigger': { - 'ref': [ - 'refs/heads/master', - ], - }, - } - -def badges(config): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'badges', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'clone': { - 'disable': True, - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'plugins/webhook:latest', - 'pull': 'always', - 'settings': { - 'urls': { - 'from_secret': 'microbadger_url', - }, - }, - }, - ], - 'depends_on': [ - 'readme', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - ], - }, - } - -def trigger(config): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'trigger', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'clone': { - 'disable': True, - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'plugins/downstream:latest', - 'pull': 'always', - 'failure': 'ignore', - 'settings': { - 'server': 'https://cloud.drone.io', - 'token': { - 'from_secret': 'downstream_token', - }, - 'repositories': config['trigger'], - }, - }, - ], - 'depends_on': [ - 'badges', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - ], - }, - } diff --git a/.github/lock.yml b/.github/lock.yml deleted file mode 100644 index f323bf4..0000000 --- a/.github/lock.yml +++ /dev/null @@ -1,9 +0,0 @@ -daysUntilLock: 365 -skipCreatedBefore: false -exemptLabels: [bug] -lockLabel: outdated -setLockReason: true - -lockComment: > - This thread has been automatically locked since there has not been any recent - activity after it was closed. Please open a new issue for related bugs. diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..8c29184 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>dockhippie/.github//renovate/preset" + ], + "packageRules": [] +} diff --git a/.github/settings.yml b/.github/settings.yml index 80d0217..75a6a98 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,8 +1,7 @@ repository: name: gitea description: Docker images for Gitea - homepage: https://hub.docker.com/r/webhippie/gitea - topics: docker, image, container + topics: docker, image private: false has_issues: true @@ -15,42 +14,83 @@ repository: allow_merge_commit: true allow_rebase_merge: true + allow_update_branch: true + allow_auto_merge: true + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + labels: - name: bug - color: d73a4a + color: fc2929 description: Something isn't working - name: duplicate - color: cfd3d7 + color: cccccc description: This issue or pull request already exists - name: enhancement - color: a2eeef + color: 84b6eb description: New feature or request - name: good first issue color: 7057ff description: Good for newcomers - name: help wanted - color: 008672 + color: 159818 description: Extra attention is needed - name: invalid - color: e4e669 + color: e6e6e6 description: This doesn't seem right - name: question - color: d876e3 + color: cc317c description: Further information is requested - name: renovate - color: e99695 + color: 1d76db description: Automated action from Renovate - name: wontfix - color: ffffff + color: 5319e7 description: This will not be worked on - - name: outdated - color: cccccc - description: This is out of scope and outdated + - name: hacktoberfest + color: d4c5f9 + description: Contribution at Hacktoberfest appreciated + - name: ready + color: ededed + description: This is ready to be worked on + - name: in progress + color: ededed + description: This is currently worked on + - name: infra + color: 006b75 + description: Related to the infrastructure + - name: lint + color: fbca04 + description: Related to linting tools + - name: poc + color: c2e0c6 + description: Proof of concept for new feature + - name: rebase + color: ffa8a5 + description: Branch requires a rebase + - name: third-party + color: e99695 + description: Depends on third-party tool or library + - name: translation + color: b60205 + description: Change or issue related to translations branches: - name: master protection: + required_pull_request_reviews: null required_status_checks: strict: true - contexts: - - continuous-integration/drone/pr + contexts: [] + enforce_admins: false + restrictions: + apps: + - renovate + users: [] + teams: + - admins + - bots + - members + +...