ci: canonicalize release SSH command
All checks were successful
State Corp Backend CI/CD / Quality gate (push) Successful in 4m5s
State Corp Backend CI/CD / Build linux/amd64 images once (push) Successful in 4m33s
State Corp Backend CI/CD / Refresh and release internal main (push) Has been skipped
State Corp Backend CI/CD / Release customer main (push) Has been skipped
State Corp Backend CI/CD / Release dev (push) Successful in 1m2s
All checks were successful
State Corp Backend CI/CD / Quality gate (push) Successful in 4m5s
State Corp Backend CI/CD / Build linux/amd64 images once (push) Successful in 4m33s
State Corp Backend CI/CD / Refresh and release internal main (push) Has been skipped
State Corp Backend CI/CD / Release customer main (push) Has been skipped
State Corp Backend CI/CD / Release dev (push) Successful in 1m2s
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
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)
|
||||
test_dir=$(mktemp -d)
|
||||
trap 'rm -rf "${test_dir}"' EXIT
|
||||
|
||||
true_path=$(type -P true)
|
||||
cp "${true_path}" "${test_dir}/ssh"
|
||||
cp "$0" "${test_dir}/ssh"
|
||||
digest="registry.dev.nii-ecos.ru/avm/state-corp-backend-web@sha256:$(printf '0%.0s' {1..64})"
|
||||
encoded_fixture=$(printf fixture | base64)
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ if [[ "${refresh_data}" == true ]]; then
|
||||
remote_args+=(--refresh-data)
|
||||
fi
|
||||
printf -v remote_command '%q ' "${release_service_path}" "${remote_args[@]}"
|
||||
remote_command="${remote_command% }"
|
||||
|
||||
# The command is deliberately assembled and validated on the client.
|
||||
# shellcheck disable=SC2029
|
||||
|
||||
Reference in New Issue
Block a user