From aea855b518ba9370c269fa821074938f0e7ac688 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 14 May 2024 08:21:25 +0200 Subject: [PATCH] add upload command --- .woodpecker/test-image.yml | 8 +++++++- gitea-package.sh | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.woodpecker/test-image.yml b/.woodpecker/test-image.yml index 87c8843..fda75e9 100644 --- a/.woodpecker/test-image.yml +++ b/.woodpecker/test-image.yml @@ -11,12 +11,18 @@ steps: test-next: image: gitea.ocram85.com/plugins/gitea-package:next pull: true + secrets: [ gitea_user, gitea_passwd] settings: + user: + from_secret: gitea_user + password: + from_secret: gitea_passwd debug: "true" owner: "testuser" package_name: "dummy_package" package_version: "0.1.0" - file_name: "./README.md" + file_source: "./README.md" + file_name: "readme.md" update: "true" when: event: pull_request diff --git a/gitea-package.sh b/gitea-package.sh index 7d37b5a..683dc4e 100755 --- a/gitea-package.sh +++ b/gitea-package.sh @@ -43,13 +43,14 @@ 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_FILE_SOURCE: $PLUGIN_FILE_SOURCE" "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 + curl --user "$PLUGIN_USER:$PLUGIN_PASSWORD" \ + --upload-file "$PLUGIN_FILE_SOURCE" \ + "$CI_FORGE_URL/api/packages/$PLUGIN_OWNER/generic/$PLUGIN_PACKAGE_NAME/$PLUGINPACKAGE_VERSION/$PLUGIN_FILE_NAME" } main() { @@ -58,8 +59,8 @@ main() { showSettings sayW "Available ENV vars:" showENV - exit 0 fi + uploadArtifact } main "$@"