Alphanet: add admin-client to alphanet.sh

This commit is contained in:
Grégoire Henry 2018-06-04 13:38:24 +02:00
parent d832205e9c
commit e1f66ffa85

View File

@ -90,6 +90,22 @@ exec_docker() {
else else
local interactive_flags="-t" local interactive_flags="-t"
fi fi
declare -a container_args=();
tmpdir="/tmp"
for arg in "$@"; do
if [[ "$arg" == 'container:'* ]]; then
local_path="${arg#container:}"
if [[ "$local_path" != '/'* ]]; then
local_path="$current_dir/$local_path"
fi
file_name=$(basename "${local_path}")
docker_path="$tmpdir/$file_name"
docker cp "${local_path}" "$docker_node_container:${docker_path}"
container_args+=("$docker_path");
else
container_args+=("${arg}");
fi
done
docker exec "$interactive_flags" "$docker_node_container" "$@" docker exec "$interactive_flags" "$docker_node_container" "$@"
} }
@ -349,26 +365,14 @@ stop_endorser() {
## Misc #################################################################### ## Misc ####################################################################
run_client() { run_client() {
assert_node_uptodate assert_node_uptodate
declare -a container_args=(); exec_docker "tezos-client" "$@"
tmpdir="/tmp" }
for arg in "$@"; do
if [[ "$arg" == 'container:'* ]]; then run_admin_client() {
local_path="${arg#container:}" assert_node_uptodate
if [[ "$local_path" != '/'* ]]; then exec_docker "tezos-admin-client" "$@"
local_path="$current_dir/$local_path"
fi
file_name=$(basename "${local_path}")
docker_path="$tmpdir/$file_name"
docker cp "${local_path}" "$docker_node_container:${docker_path}"
container_args+=("$docker_path");
else
container_args+=("${arg}");
fi
done
exec_docker tezos-client "${container_args[@]}"
} }
run_shell() { run_shell() {
@ -648,6 +652,9 @@ case "$command" in
client) client)
run_client "$@" run_client "$@"
;; ;;
admin-client)
run_admin_client "$@"
;;
check_script) check_script)
warn_script_uptodate verbose warn_script_uptodate verbose
;; ;;