edge-connect-delete-action/endpoint.sh

30 lines
754 B
Bash
Raw Normal View History

2025-10-01 11:46:21 +02:00
#!/bin/bash
set -euo pipefail
2025-10-02 14:07:01 +02:00
main() {
local download_url="https://edp.buildth.ing/DevFW-CICD/edge-connect-client/releases/download/${INPUT_VERSION}/edge-connect-client_Linux_x86_64.tar.gz"
echo "Downloading edge-connect-client from ${download_url}"
local temp_dir
temp_dir=$(mktemp -d)
curl -sSL "${download_url}" | tar -xz -C "${temp_dir}"
local cli_path="${temp_dir}/edge-connect-client"
chmod +x "${cli_path}"
local -a args
args=("--file" "${INPUT_CONFIG_FILE}")
2025-10-02 14:07:01 +02:00
if [[ "${INPUT_DRY_RUN}" == "true" ]]; then
2025-10-02 14:07:01 +02:00
args+=("--dry-run")
fi
echo Executing: "${cli_path}" apply "${args[@]}"
2025-10-02 14:07:01 +02:00
# The CLI uses an interactive prompt, so we need to pipe "yes" to it.
yes | "${cli_path}" apply "${args[@]}"
}
main