From e055dce72ac1bfdaa1f98bd05e2b207c09552f0c Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 11:00:14 +0200 Subject: [PATCH 01/24] migrate content --- .woodpecker/ci.yml | 82 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 12 +++++++ gitea-package.sh | 49 +++++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 .woodpecker/ci.yml create mode 100644 Dockerfile create mode 100644 gitea-package.sh diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml new file mode 100644 index 0000000..2e01d7c --- /dev/null +++ b/.woodpecker/ci.yml @@ -0,0 +1,82 @@ +when: + - event: [pull_request, tag, cron] + - event: push + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +variables: + - &build_plugin 'woodpeckerci/plugin-docker-buildx:3.2.1' + # deployment targets + - &publish_repos 'ocram85/plugin-gitea-package,gitea.ocram85.com/plugins/gitea-package' + # logins for deployment targets + - publish_logins: &publish_logins + # Default DockerHub login + - registry: https://index.docker.io/v1/ + username: + from_secret: docker_user + password: + from_secret: docker_passwd + # Additional Quay.IO login + - registry: https://gitea.ocram85.com + username: + from_secret: gitea_user + password: + from_secret: gitea_passwd + +steps: + test: + image: *build_plugin + settings: + dry_run: true + registry: gitea.ocram85.com + repo: test + dockerfile: Dockerfile + platforms: linux/amd64 + auto_tag: true + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + when: + event: pull_request + branch: ${CI_REPO_DEFAULT_BRANCH} + + publish: + image: *build_plugin + settings: + repo: *publish_repos + dockerfile: Dockerfile + platforms: linux/amd64 + auto_tag: true + logins: *publish_logins + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + when: + event: [push, tag, cron] + branch: ${CI_REPO_DEFAULT_BRANCH} + + build-next: + image: *build_plugin + settings: + repo: *publish_repos + dockerfile: Dockerfile + platforms: linux/amd64 + tag: next + logins: *publish_logins + build_args: + - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + - TAG=${CI_COMMIT_TAG} + when: + event: [pull_request] + + gitea-release: + image: plugins/gitea-release + settings: + api_key: + from_secret: RENOVATE_TOKEN + base_url: https://gitea.ocram85.com + title: ${CI_COMMIT_TAG} + note: "> :bulb: **Note:** See [CHANGELOG.md](src/branch/master/CHANGELOG.md) for recent changes." + when: + event: [tag] + branch: ${CI_REPO_DEFAULT_BRANCH} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5b4ab82 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM curlimages/curl:8.7.1 + +ENV PLUGIN_OWNER +ENV PLUGIN_PACKAGE_NAME +ENV PLUGIN_PACKAGE_VERSION +ENV PLUGIN_FILE_NAME + +ENV PLUGIN_UPDATE + +COPY gitea-package.sh /app +WORKDIR /app +CMD [ "gitea-package.sh" ] diff --git a/gitea-package.sh b/gitea-package.sh new file mode 100644 index 0000000..8d0d499 --- /dev/null +++ b/gitea-package.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env sh + +set -e + +say() { + if [ -n "$2" ]; then + printf "🤖 \e[32mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" + else + printf "🤖 \e[32mgitea-package\e[0m: %s \n" "$1" + fi +} + +sayE() { + if [ -n "$2" ]; then + printf "🤖 \e[31mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2 + else + printf "🤖 \e[31mgitea-package\e[0m: %s \n" "$1" 1>&2 + fi +} + +sayW() { + if [ -n "$2" ]; then + printf "🤖 \e[33mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2 + else + printf "🤖 \e[33mgitea-package\e[0m: %s \n" "$1" 1>&2 + fi +} + +showHelp() { + cat << HELP + 🤖 gitea-package Woodpecker-CI Plugin + + Syntax: +HELP +} + +showENV () { + say "PLUGIN_OWNER: $PLUGIN_OWNER" + say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" + say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" + say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" + say "PLUGIN_UPDATE: $PLUGIN_UPDATE" +} + +main() { + showENV +} + +main "$@" -- 2.45.2 From ad27a64d576303cba739a24a8182758bebc9fc5e Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 11:05:43 +0200 Subject: [PATCH 02/24] update tasks --- .changelog.yml | 38 ++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 37 +++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 0 gitea-package.sh | 0 4 files changed, 75 insertions(+) create mode 100644 .changelog.yml create mode 100644 .vscode/tasks.json create mode 100644 CHANGELOG.md mode change 100644 => 100755 gitea-package.sh diff --git a/.changelog.yml b/.changelog.yml new file mode 100644 index 0000000..c1ab6d4 --- /dev/null +++ b/.changelog.yml @@ -0,0 +1,38 @@ +# The full repository name +repo: plugins/gitea-package + +# Service type (gitea or github) +service: gitea + +# Base URL for Gitea instance if using gitea service type (optional) +# Default: https://gitea.com +base-url: https://gitea.ocram85.com + +# Changelog groups and which labeled PRs to add to each group +groups: + - name: 🐛 BUGFIXES + labels: + - bug + - name: ✨ FEATURES + labels: + - feature + - name: 🛠️ ENHANCEMENTS + labels: + - enhancement + - name: 📦 BUILD + labels: + - pipeline + - name: 🤖 DEPENDENCIES + labels: + - renovate + - name: 📚 DOCS + labels: + - docs + - name: ⚙️ META + labels: + - meta + - name: 🔖 MISC + default: true + +# regex indicating which labels to skip for the changelog +skip-labels: skip-changelog|backport\/.+ diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..b72665a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,37 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Update GiteaChangelog", + "type": "shell", + "command": [ + "mv 'CHANGELOG.md' 'CHANGELOG.back' &&", + "changelog -m '${input:Milestone}' --token '${input:GiteaToken}' -c .changelog.yml generate > CHANGELOG.md &&", + "echo '' >> CHANGELOG.md &&", + "cat CHANGELOG.back >> CHANGELOG.md &&", + "rm CHANGELOG.back" + ], + "problemMatcher": [] + } + ], + "inputs": [ + { + "id": "GiteaToken", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "echo $GITEA_TOKEN", + "description": "Your personal Gitea access token" + } + }, + { + "id": "Milestone", + "type": "command", + "command": "shellCommand.execute", + "args": { + "description": "Select or enter a open milestone", + "command": "tea milestone ls -f title --output simple" + } + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/gitea-package.sh b/gitea-package.sh old mode 100644 new mode 100755 -- 2.45.2 From 1b5290efc1c24c3f604e59894dd09e7fec11cb0f Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:36:30 +0200 Subject: [PATCH 03/24] wip --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c767df2..9a88aee 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@

- Master Branch Build Status + Main Branch Build Status

-- 2.45.2 From a08e397b7d5595c79fa425bc10706c1c1a65ebf3 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:38:29 +0200 Subject: [PATCH 04/24] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a88aee..1630e8a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@

- Pluging to Publish Artifatcs to Gitea Generic Package Registry + Plugin to Publish Artifacts to Gitea Generic Package Registry

-- 2.45.2 From 9dba2b27d8d4eec3dc05c2503c43da898236a1fd Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:47:32 +0200 Subject: [PATCH 05/24] test --- Dockerfile | 11 ++++++----- gitea-package.sh | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5b4ab82..2f6ea56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ FROM curlimages/curl:8.7.1 -ENV PLUGIN_OWNER -ENV PLUGIN_PACKAGE_NAME -ENV PLUGIN_PACKAGE_VERSION -ENV PLUGIN_FILE_NAME +#ENV PLUGIN_OWNER +#ENV PLUGIN_PACKAGE_NAME +#ENV PLUGIN_PACKAGE_VERSION +#ENV PLUGIN_FILE_NAME -ENV PLUGIN_UPDATE +#ENV PLUGIN_UPDATE +ENV PLUGIN_DEBUG="1" COPY gitea-package.sh /app WORKDIR /app diff --git a/gitea-package.sh b/gitea-package.sh index 8d0d499..87ac66f 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -43,6 +43,11 @@ showENV () { } main() { + if [ -n "$PLUGIN_DEBUG" ]; then + echo + else + sayW "Debug mode disabled." + fi showENV } -- 2.45.2 From b9330db0cf9bb239b7fdd327a0abc6448ef471bd Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:49:44 +0200 Subject: [PATCH 06/24] wip --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2f6ea56..232cfae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM curlimages/curl:8.7.1 - +LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_OWNER #ENV PLUGIN_PACKAGE_NAME #ENV PLUGIN_PACKAGE_VERSION -- 2.45.2 From b7f9eadccb8bb2edb6ca3f2707c3971087b50493 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:51:20 +0200 Subject: [PATCH 07/24] fix copy --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 232cfae..a1df55a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,6 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_UPDATE ENV PLUGIN_DEBUG="1" -COPY gitea-package.sh /app +COPY gitea-package.sh /app/ WORKDIR /app CMD [ "gitea-package.sh" ] -- 2.45.2 From f172d101623a41eaf1e1638ed460f0f748433326 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:56:59 +0200 Subject: [PATCH 08/24] add test step --- .woodpecker/test-image.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .woodpecker/test-image.yml diff --git a/.woodpecker/test-image.yml b/.woodpecker/test-image.yml new file mode 100644 index 0000000..d444efd --- /dev/null +++ b/.woodpecker/test-image.yml @@ -0,0 +1,19 @@ +when: + - event: [pull_request, tag, cron] + - event: push + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +steps: + test-next: + image: gitea.ocram85.com/plugins/gitea-package:next + pull: true + settings: + debug: "true" + package_name: "dummy_package" + package_version: "0.1.0" + file_name: "./README.md" + update: "true" + when: + event: pull_request + branch: ${CI_REPO_DEFAULT_BRANCH} -- 2.45.2 From 75e790f3e0c14ce3855c768052eed5ddaa676da9 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 14:59:05 +0200 Subject: [PATCH 09/24] wip --- .woodpecker/test-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.woodpecker/test-image.yml b/.woodpecker/test-image.yml index d444efd..2614e08 100644 --- a/.woodpecker/test-image.yml +++ b/.woodpecker/test-image.yml @@ -4,6 +4,9 @@ when: branch: - ${CI_REPO_DEFAULT_BRANCH} +depends_on: + - "ci" + steps: test-next: image: gitea.ocram85.com/plugins/gitea-package:next -- 2.45.2 From 6423b4a43829c9d4cae6fd26f830fca48802b8b4 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:00:22 +0200 Subject: [PATCH 10/24] fix entrypoint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a1df55a..59d10e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ ENV PLUGIN_DEBUG="1" COPY gitea-package.sh /app/ WORKDIR /app -CMD [ "gitea-package.sh" ] +ENTRYPOINT [ "gitea-package.sh" ] -- 2.45.2 From 7685650cf146e67552343e41c163deb22b2d43f6 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:01:37 +0200 Subject: [PATCH 11/24] fix script exec --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 59d10e4..c311e28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ ENV PLUGIN_DEBUG="1" COPY gitea-package.sh /app/ WORKDIR /app -ENTRYPOINT [ "gitea-package.sh" ] +ENTRYPOINT [ "sh," "/app/gitea-package.sh" ] -- 2.45.2 From deef3aa5e1defdfa27208fd81970544335114b0c Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:03:24 +0200 Subject: [PATCH 12/24] fix debug script --- gitea-package.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitea-package.sh b/gitea-package.sh index 87ac66f..1d8b974 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -44,11 +44,10 @@ showENV () { main() { if [ -n "$PLUGIN_DEBUG" ]; then - echo + showENV else sayW "Debug mode disabled." fi - showENV } main "$@" -- 2.45.2 From 00d1650f3a179c0856a5f26d7c87e32e2f451014 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:05:09 +0200 Subject: [PATCH 13/24] debug --- gitea-package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitea-package.sh b/gitea-package.sh index 1d8b974..e12652c 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -e +set -ex say() { if [ -n "$2" ]; then -- 2.45.2 From 40bae01243baa2121848243efc42ec3901172b90 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:10:46 +0200 Subject: [PATCH 14/24] debug entrypoint --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c311e28..e7be439 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,5 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" ENV PLUGIN_DEBUG="1" COPY gitea-package.sh /app/ -WORKDIR /app -ENTRYPOINT [ "sh," "/app/gitea-package.sh" ] +RUN [ "chmod", "+x", "/app/gitea-package.sh" ] +ENTRYPOINT [ "/app/gitea-package.sh" ] -- 2.45.2 From d3011b8343b01b541094ed34f26ee6bfe870cc47 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:11:50 +0200 Subject: [PATCH 15/24] debug --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e7be439..d259e6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,6 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_UPDATE ENV PLUGIN_DEBUG="1" -COPY gitea-package.sh /app/ +COPY ./gitea-package.sh /app/gitea-package.sh RUN [ "chmod", "+x", "/app/gitea-package.sh" ] ENTRYPOINT [ "/app/gitea-package.sh" ] -- 2.45.2 From 854d3126174dff6adf51b4fb080f713e0496f66d Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:18:08 +0200 Subject: [PATCH 16/24] debug script --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d259e6a..9b5a649 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,10 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_UPDATE ENV PLUGIN_DEBUG="1" - -COPY ./gitea-package.sh /app/gitea-package.sh +USER root +COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh RUN [ "chmod", "+x", "/app/gitea-package.sh" ] + +USER curl_user + ENTRYPOINT [ "/app/gitea-package.sh" ] -- 2.45.2 From 9c5b7754cb0eba590854a661a85cec11899f77ca Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:19:22 +0200 Subject: [PATCH 17/24] remove debug mode --- Dockerfile | 2 +- gitea-package.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b5a649..26cfe35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_UPDATE ENV PLUGIN_DEBUG="1" USER root -COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh +#COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh RUN [ "chmod", "+x", "/app/gitea-package.sh" ] USER curl_user diff --git a/gitea-package.sh b/gitea-package.sh index e12652c..1d8b974 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -ex +set -e say() { if [ -n "$2" ]; then -- 2.45.2 From ff93cf1cab8aa1b4c185e7325c13ba2c9857e6be Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 13 May 2024 15:20:09 +0200 Subject: [PATCH 18/24] wip --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26cfe35..fa56764 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,8 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_UPDATE ENV PLUGIN_DEBUG="1" USER root -#COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh -RUN [ "chmod", "+x", "/app/gitea-package.sh" ] +COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh +#RUN [ "chmod", "+x", "/app/gitea-package.sh" ] USER curl_user -- 2.45.2 From 18fceb89b4ab4ee7652c8f35cc65df4e1749c859 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:02:31 +0200 Subject: [PATCH 19/24] add missing env in build test --- .woodpecker/test-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/test-image.yml b/.woodpecker/test-image.yml index 2614e08..530c018 100644 --- a/.woodpecker/test-image.yml +++ b/.woodpecker/test-image.yml @@ -13,6 +13,7 @@ steps: pull: true settings: debug: "true" + plugin_owner: "testuser" package_name: "dummy_package" package_version: "0.1.0" file_name: "./README.md" -- 2.45.2 From 94b3e707d3ec14563526d4322c60d8c9d52c7574 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:03:47 +0200 Subject: [PATCH 20/24] fix typo --- .woodpecker/test-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/test-image.yml b/.woodpecker/test-image.yml index 530c018..87c8843 100644 --- a/.woodpecker/test-image.yml +++ b/.woodpecker/test-image.yml @@ -13,7 +13,7 @@ steps: pull: true settings: debug: "true" - plugin_owner: "testuser" + owner: "testuser" package_name: "dummy_package" package_version: "0.1.0" file_name: "./README.md" -- 2.45.2 From ce9cb10c89b3737db15e7c6f67112d362fc704da Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:06:28 +0200 Subject: [PATCH 21/24] extend output --- gitea-package.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gitea-package.sh b/gitea-package.sh index 1d8b974..6331dc2 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -35,11 +35,12 @@ HELP } showENV () { - say "PLUGIN_OWNER: $PLUGIN_OWNER" - say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" - say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" - say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" - say "PLUGIN_UPDATE: $PLUGIN_UPDATE" + sayW "Showing plugin settings:" "showENV" + say "PLUGIN_OWNER: $PLUGIN_OWNER" "showENV" + say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" "showENV" + say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" "showENV" + say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" "showENV" + say "PLUGIN_UPDATE: $PLUGIN_UPDATE" "showENV" } main() { -- 2.45.2 From 7aaf7064f074b06a0923245b19a54303efec40ef Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:21:00 +0200 Subject: [PATCH 22/24] fix output order --- gitea-package.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitea-package.sh b/gitea-package.sh index 6331dc2..a3e8fc2 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -45,7 +45,9 @@ showENV () { main() { if [ -n "$PLUGIN_DEBUG" ]; then + sayW "Debug mode enabled.Showing plugin settings:" showENV + exit 0 else sayW "Debug mode disabled." fi -- 2.45.2 From 8a94b09c870b91ab92d54d469d78962573f1d01d Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:31:31 +0200 Subject: [PATCH 23/24] extend output --- gitea-package.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/gitea-package.sh b/gitea-package.sh index a3e8fc2..ddfbecb 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -34,18 +34,28 @@ showHelp() { HELP } -showENV () { - sayW "Showing plugin settings:" "showENV" - say "PLUGIN_OWNER: $PLUGIN_OWNER" "showENV" - say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" "showENV" - say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" "showENV" - say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" "showENV" - say "PLUGIN_UPDATE: $PLUGIN_UPDATE" "showENV" +showENV() { + env | sort +} + +showSettings() { + say "PLUGIN_OWNER: $PLUGIN_OWNER" "showSettings" + say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME" "showSettings" + say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION" "showSettings" + say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME" "showSettings" + say "PLUGIN_UPDATE: $PLUGIN_UPDATE" "showSettings" +} + +uploadArtifact() { + curl --user your_username:your_password_or_token \ + --upload-file path/to/file.bin \ + https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin } main() { if [ -n "$PLUGIN_DEBUG" ]; then - sayW "Debug mode enabled.Showing plugin settings:" + sayW "Debug mode enabled." + showSettings showENV exit 0 else -- 2.45.2 From f78508b9103dd54fa1d41cf18684b4856b91a0cf Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 07:38:26 +0200 Subject: [PATCH 24/24] disable debug mode by default --- Dockerfile | 2 +- gitea-package.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa56764..a48be7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.authors="marco@ocram85.com" #ENV PLUGIN_FILE_NAME #ENV PLUGIN_UPDATE -ENV PLUGIN_DEBUG="1" +#ENV PLUGIN_DEBUG="1" USER root COPY --chown=100:101 --chmod=755 ./gitea-package.sh /app/gitea-package.sh #RUN [ "chmod", "+x", "/app/gitea-package.sh" ] diff --git a/gitea-package.sh b/gitea-package.sh index ddfbecb..7d37b5a 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -56,10 +56,9 @@ main() { if [ -n "$PLUGIN_DEBUG" ]; then sayW "Debug mode enabled." showSettings + sayW "Available ENV vars:" showENV exit 0 - else - sayW "Debug mode disabled." fi } -- 2.45.2