From c7ef7c99a3150e29a7a0db498aa66a97cd04dbd5 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 17 Aug 2023 15:09:54 -0500 Subject: [PATCH] add some more variables for config --- push-container.nu | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/push-container.nu b/push-container.nu index 12ef294..f4bc449 100644 --- a/push-container.nu +++ b/push-container.nu @@ -5,7 +5,7 @@ def main [ --repository: string = "" # container repository --no-latest-tag # Don't add "latest" tag to list of tags --no-drone-tag # Don't add tag calculated from DRONE_BUILD_NUMBER and DRONE_COMMIT_SHA - --no-github-tag # Don't add tag calculated from GItHUB_RUN_NUMBER and GITHUB_SHA + --no-github-tag # Don't add tag calculated from GITHUB_RUN_NUMBER and GITHUB_SHA ] { if not ($input | path exists) { print $"($input) does not exist!" @@ -63,6 +63,12 @@ def main [ (not ($env | get -i PLUGIN_PASSWORD | is-empty)) ) { {username: $env.PLUGIN_USERNAME, password: $env.PLUGIN_PASSWORD} + } else if ( + (not ($env | get -i USERNAME | is-empty)) + and + (not ($env | get -i PASSWORD | is-empty)) + ) { + {username: $env.USERNAME, password: $env.PASSWORD} } else { print "Unable to determine authentication parameters!" exit 1 @@ -73,6 +79,8 @@ def main [ if ($registry | is-empty) { if not ($env | get -i PLUGIN_REGISTRY | is-empty) { $env.PLUGIN_REGISTRY + } else if not ($env | get -i REGISTRY | is-empty) { + $env.REGISTRY } else { print "No registry specified!" exit 1 @@ -86,6 +94,8 @@ def main [ if ($repository | is-empty) { if not ($env | get -i PLUGIN_REPOSITORY | is-empty) { $env.PLUGIN_REPOSITORY + } else if not ($env | get -i REPOSITORY | is-empty) { + $env.REPOSITORY } else { print "No repository specified!" exit 1