From 3c57de2d88e847dfb2454f87eed2290acc37ea47 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 7 Nov 2023 16:36:14 +0100 Subject: [PATCH 1/3] refactor: migrate to woodpecker ci --- .chglog/config.yml | 2 +- .drone.yml | 125 ---------------------------------- .gitsv/config.yml | 47 +++++++++++++ .prettierignore | 1 - .woodpecker/build-package.yml | 44 ++++++++++++ .woodpecker/docs.yml | 29 ++++++++ .woodpecker/notify.yml | 26 +++++++ .woodpecker/test.yml | 13 ++++ README.md | 10 ++- 9 files changed, 167 insertions(+), 130 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitsv/config.yml create mode 100644 .woodpecker/build-package.yml create mode 100644 .woodpecker/docs.yml create mode 100644 .woodpecker/notify.yml create mode 100644 .woodpecker/test.yml diff --git a/.chglog/config.yml b/.chglog/config.yml index 2f228df..b75dbfd 100755 --- a/.chglog/config.yml +++ b/.chglog/config.yml @@ -2,7 +2,7 @@ style: github template: CHANGELOG.tpl.md info: title: CHANGELOG - repository_url: https://gitea.rknet.org/docker/container-library + repository_url: https://gitea.rknet.org/container/container-library options: commit_groups: title_maps: diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index ccb51a4..0000000 --- a/.drone.yml +++ /dev/null @@ -1,125 +0,0 @@ ---- -kind: pipeline -name: test - -platform: - os: linux - arch: amd64 - -steps: - - name: lint - image: koalaman/shellcheck-alpine:stable - commands: - - shellcheck --version - - grep -ErlI '^#!(.*/|.*env +)(sh|bash|ksh)' ./overlay/ | xargs shellcheck - - - name: markdownlint - image: thegeeklab/markdownlint-cli - commands: - - markdownlint 'README.md' - -trigger: - ref: - - refs/heads/main - - refs/pull/** - - refs/tags/** - ---- -kind: pipeline -name: build-package - -platform: - os: linux - arch: amd64 - -steps: - - name: package - image: thegeeklab/alpine-tools - commands: - - mkdir dist/ - - tar -C ./overlay -zcvf dist/container-library.tar.gz . - - - name: checksum - image: thegeeklab/alpine-tools - 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-gitea - image: plugins/gitea-release - settings: - api_key: - from_secret: gitea_token - base_url: https://gitea.rknet.org - files: - - dist/* - - sha256sum.txt - note: CHANGELOG.md - overwrite: true - title: ${DRONE_TAG} - when: - ref: - - refs/tags/** - -trigger: - ref: - - refs/heads/main - - refs/pull/** - - refs/tags/** - -depends_on: - - test - ---- -kind: pipeline -name: notifications - -platform: - os: linux - arch: amd64 - -steps: - - 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 }}**
Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}
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 - ---- -kind: signature -hmac: 84c6339bfe7ef512611d4732b5edb1c42ac8ed3a136fa2fcfd56a82c5a7c1e9b - -... diff --git a/.gitsv/config.yml b/.gitsv/config.yml new file mode 100644 index 0000000..acaf506 --- /dev/null +++ b/.gitsv/config.yml @@ -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]+" diff --git a/.prettierignore b/.prettierignore index 23a4f05..135c35d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,2 @@ -.drone.yml *.tpl.md LICENSE diff --git a/.woodpecker/build-package.yml b/.woodpecker/build-package.yml new file mode 100644 index 0000000..00c9e69 --- /dev/null +++ b/.woodpecker/build-package.yml @@ -0,0 +1,44 @@ +--- +when: + - event: [pull_request, tag] + - event: [push, manual] + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +steps: + package: + image: quay.io/thegeeklab/alpine-tools + commands: + - mkdir dist/ + - tar -C ./overlay -zcvf dist/container-library.tar.gz . + + checksum: + image: quay.io/thegeeklab/alpine-tools + commands: + - cd dist/ && sha256sum * > ../sha256sum.txt + + changelog: + image: quay.io/thegeeklab/git-sv + commands: + - git fetch --depth=2147483647 + - git sv current-version + - git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md + - cat CHANGELOG.md + + publish-gitea: + image: plugins/gitea-release + settings: + api_key: + from_secret: gitea_token + base_url: https://gitea.rknet.org + note: CHANGELOG.md + overwrite: true + files: + - dist/* + - sha256sum.txt + title: ${CI_COMMIT_TAG} + when: + - event: [tag] + +depends_on: + - test diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml new file mode 100644 index 0000000..21b2655 --- /dev/null +++ b/.woodpecker/docs.yml @@ -0,0 +1,29 @@ +--- +when: + - event: [pull_request, tag] + - event: [push, manual] + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +steps: + markdownlint: + image: quay.io/thegeeklab/markdownlint-cli + commands: + - markdownlint 'README.md' + + spellcheck: + image: quay.io/thegeeklab/alpine-tools + commands: + - spellchecker --files '_docs/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls + environment: + FORCE_COLOR: "true" + NPM_CONFIG_LOGLEVEL: "error" + + link-validation: + image: docker.io/lycheeverse/lychee + group: test + commands: + - lychee --no-progress --format detailed README.md + +depends_on: + - build-package diff --git a/.woodpecker/notify.yml b/.woodpecker/notify.yml new file mode 100644 index 0000000..a851904 --- /dev/null +++ b/.woodpecker/notify.yml @@ -0,0 +1,26 @@ +--- +when: + - event: [tag] + - event: [push, manual] + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +runs_on: [success, failure] + +steps: + 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 diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml new file mode 100644 index 0000000..3c1fd2d --- /dev/null +++ b/.woodpecker/test.yml @@ -0,0 +1,13 @@ +--- +when: + - event: [pull_request, tag] + - event: [push, manual] + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +steps: + lint: + image: docker.io/koalaman/shellcheck-alpine:stable + commands: + - shellcheck --version + - grep -ErlI '^#!(.*/|.*env +)(sh|bash|ksh)' ./overlay/ | xargs shellcheck diff --git a/README.md b/README.md index fc228f8..d3c6e73 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # container-library -[![Build Status](https://img.shields.io/drone/build/docker/container-library?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/container-library) -[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/container-library/src/branch/main/LICENSE) + + +[![Build Status](https://ci.rknet.org/api/badges/container/container-library/status.svg)](https://ci.rknet.org/repos/container/container-library) +[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/container/container-library/src/branch/main/LICENSE) + + Basic utilities script library to use in container images. ## License -This project is licensed under the MIT License - see the [LICENSE](https://gitea.rknet.org/docker/container-library/src/branch/main/LICENSE) file for details. +This project is licensed under the MIT License - see the [LICENSE](https://gitea.rknet.org/container/container-library/src/branch/main/LICENSE) file for details. -- 2.45.2 From f93853204112bd693e6108bd4c8cf9d68a7730c1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 7 Nov 2023 16:39:48 +0100 Subject: [PATCH 2/3] cleanup --- .chglog/CHANGELOG.tpl.md | 23 ----------------------- .chglog/config.yml | 25 ------------------------- 2 files changed, 48 deletions(-) delete mode 100755 .chglog/CHANGELOG.tpl.md delete mode 100755 .chglog/config.yml diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100755 index cc0367b..0000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -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 "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pulls/${2}") | trim }} -{{ end }} -{{- end -}} - -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### {{ .Title }} - -{{ range .Notes }} -{{ .Body }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100755 index b75dbfd..0000000 --- a/.chglog/config.yml +++ /dev/null @@ -1,25 +0,0 @@ -style: github -template: CHANGELOG.tpl.md -info: - title: CHANGELOG - repository_url: https://gitea.rknet.org/container/container-library -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.45.2 From fd59289845f56c7e132184bf7e48c4db0ea92f1a Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 7 Nov 2023 16:42:08 +0100 Subject: [PATCH 3/3] add dictionary --- .dictionary | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .dictionary diff --git a/.dictionary b/.dictionary new file mode 100644 index 0000000..e69de29 -- 2.45.2