ci: canonicalize release SSH command

This commit is contained in:
2026-08-27 14:08:54 +03:00
parent 5ec7c411a0
commit 341fd6ee3f
2 changed files with 9 additions and 2 deletions

View File

@@ -1,12 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
if [[ "${0##*/}" == ssh ]]; then
remote_command="${!#}"
[[ "${remote_command}" == /opt/ecos-dev/release-service\ * ]]
[[ "${remote_command}" != *' ' ]]
exit 0
fi
script_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd) script_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
test_dir=$(mktemp -d) test_dir=$(mktemp -d)
trap 'rm -rf "${test_dir}"' EXIT trap 'rm -rf "${test_dir}"' EXIT
true_path=$(type -P true) cp "$0" "${test_dir}/ssh"
cp "${true_path}" "${test_dir}/ssh"
digest="registry.dev.nii-ecos.ru/avm/state-corp-backend-web@sha256:$(printf '0%.0s' {1..64})" digest="registry.dev.nii-ecos.ru/avm/state-corp-backend-web@sha256:$(printf '0%.0s' {1..64})"
encoded_fixture=$(printf fixture | base64) encoded_fixture=$(printf fixture | base64)

View File

@@ -133,6 +133,7 @@ if [[ "${refresh_data}" == true ]]; then
remote_args+=(--refresh-data) remote_args+=(--refresh-data)
fi fi
printf -v remote_command '%q ' "${release_service_path}" "${remote_args[@]}" printf -v remote_command '%q ' "${release_service_path}" "${remote_args[@]}"
remote_command="${remote_command% }"
# The command is deliberately assembled and validated on the client. # The command is deliberately assembled and validated on the client.
# shellcheck disable=SC2029 # shellcheck disable=SC2029