From fc55dce37f2e58b46896e2d66e6b39867ab6d253 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 27 Oct 2023 07:34:55 +0900 Subject: [PATCH] chore(cmdx connect): set the default os and arch (#16708) --- cmdx.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cmdx.yaml b/cmdx.yaml index ddfedff7b35..d7574a04602 100644 --- a/cmdx.yaml +++ b/cmdx.yaml @@ -85,15 +85,27 @@ tasks: These arguments are set to AQUA_GOOS and AQUA_GOARCH. args: - name: os - required: true + required: false + default: linux + script_envs: + - OS - name: arch - required: true + required: false + script_envs: + - ARCH shell: - "bash" - "-c" script: | - set -euxo pipefail - docker exec -ti aqua-registry env AQUA_GOOS="{{.os}}" AQUA_GOARCH="{{.arch}}" bash + set -eux + if [ -z "${ARCH:-}" ]; then + ARCH=$(uname -m) + case $ARCH in + x86_64) ARCH="amd64" ;; + aarch64) ARCH="arm64" ;; + esac + fi + docker exec -ti aqua-registry env AQUA_GOOS="$OS" AQUA_GOARCH="$ARCH" bash - name: generate-registry short: gr