diff --git a/config.json b/config.json index ead8e77..d19a4fe 100644 --- a/config.json +++ b/config.json @@ -1 +1,19 @@ -{"auths":{"registry.kokuwa.io":{"auth":"d29vZHBlY2tlcjo5cVRrVlpXSW1ITndXWXVMZ1pMajVST0FuYmZlOTEyUjlLWFFIVW51MG1iOGx5UWl5Z3hFUEZxVTN0REo5VzdE"},"ghcr.io":{"auth":"c3NjaG5hYmU6Z2hwX0lHVEswWkk0YTBqN2EzTjNIMlBmOEc2UFl1eGpEYjRmUlk0Yw=="},"https://index.docker.io/v1/":{"auth":"c3NjaG5hYmU6ZGNrcl9wYXRfZ3RnZ1k4RFdzUjJmZlRLTU1yWVI2cFR5Y1VF=="}}} +{ + "auths": [ + { + "docker.io": { + "auth": "c3NjaG5hYmU6ZGNrcl9wYXRfZ3RnZ1k4RFdzUjJmZlRLTU1yWVI2cFR5Y1VF" + } + }, + { + "ghcr.io": { + "auth": "a29rdXdhaW8tYm90OmdocF9SS2tmTXludk5SemJ6b0hCUnR3dGZmYUhqNUxPQ0wweGhRVkw=" + } + }, + { + "registry.kokuwa.io": { + "auth": "d29vZHBlY2tlcjp6YWtfY2QyNGZmODg2MTFhNDQxODkyM2ZhNDEyYTQ1OGQ0YzI=" + } + } + ] +} diff --git a/entrypoint.sh b/entrypoint.sh index 54293cb..130b9f1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,14 +1,6 @@ #!/usr/bin/env bash -set -eXu; -#CI_PIPELINE_NUMBER=1 -#CI_REPO_URL=CI_REPO_URL -#CI_COMMIT_SHA=123 -#CI_REPO_CLONE_URL=CI_REPO_CLONE_URL -#PLUGIN_ANNOTATION='{"org.opencontainers.image.description":"A Woodpecker CI plugin for yamllint to lint yaml files.","org.opencontainers.image.documentation":"$CI_REPO_URL/README.md","org.opencontainers.image.licenses":"EUPL-1.2","org.opencontainers.image.ref.name":"kokuwaio/buildctl","org.opencontainers.image.revision":"$CI_COMMIT_SHA","org.opencontainers.image.source":"$CI_REPO_CLONE_URL","org.opencontainers.image.title":"Buildctl Plugin","org.opencontainers.image.url":"$CI_REPO_URL","org.opencontainers.image.vendor":"kokuwa.io","org.opencontainers.image.version":"v0.21.0"}' -#PLUGIN_NAME=registry.kokuwa.io/buildctl:$CI_PIPELINE_NUMBER -#PLUGIN_PLATFORM=linux/amd64,linux/arm64 -#PLUGIN_AUTH='{"auths":{"registry.kokuwa.io":{"auth":"d29vZHBlY2tlcjo5cVRrVlpXSW1ITndXWXVMZ1pMajVST0FuYmZlOTEyUjlLWFFIVW51MG1iOGx5UWl5Z3hFUEZxVTN0REo5VzdE"},"ghcr.io":{"auth":"c3NjaG5hYmU6Z2hwX0lHVEswWkk0YTBqN2EzTjNIMlBmOEc2UFl1eGpEYjRmUlk0Yw=="},"https://index.docker.io/v1/":{"auth":"c3NjaG5hYmU6ZGNrcl9wYXRfZ3RnZ1k4RFdzUjJmZlRLTU1yWVI2cFR5Y1VF=="}}}' -echo $PLUGIN_AUTH | base64 -w0 +set -eu; + ## ## check input ## @@ -31,7 +23,7 @@ SOURCE_DATE_EPOCH=${PLUGIN_SOURCE_DATE_EPOCH:-0} if [[ -n "${PLUGIN_AUTH:-}" ]]; then DOCKER_CONFIG=${DOCKER_CONFIG:-$PWD} mkdir -p "$DOCKER_CONFIG" - echo "$PLUGIN_AUTH" > "$DOCKER_CONFIG/config.json" + echo "$PLUGIN_AUTH" | jq -r 'to_entries|map({(.key):{"auth":(.value.username+":"+.value.password)|@base64}})|{"auths":.}' > "$DOCKER_CONFIG/config.json" echo Stored credentials at "$DOCKER_CONFIG/config.json" echo fi diff --git a/renovate.json b/renovate.json index 3768cf1..6ea399d 100644 --- a/renovate.json +++ b/renovate.json @@ -55,7 +55,7 @@ "managerFilePatterns": ["Dockerfile"], "matchStrings": ["https://github.com/jqlang/jq/releases/download/(?jq-[0-9]+\\.[0-9]+\\.[0-9]+)/jq-linux-$SUFFIX"], "datasourceTemplate": "github-tags", - "packageNameTemplate": "qlang/jq" + "packageNameTemplate": "jqlang/jq" } ]