clients/remote_cli/config_aliases.sh
Guilherme Costa a87ab151d9 Adding software alias to remote-cli
This adds software command alias to the list of commands that can
be run through the remote-cli.

Test Plan:

Pass: After configuring the remote-cli, certify that the software
      command (e.g., software list) was executed from the Docker image.

Depends-On: https://review.opendev.org/c/starlingx/update/+/901240
Depends-On: https://review.opendev.org/c/starlingx/upstream/+/901241

Story: 2010676
Task: 49165

Change-Id: I41be730022d77ba1c4898aa7dd2cc33c8e39e7e8
Signed-off-by: Guilherme Costa <guilherme.costa@windriver.com>
2023-11-30 12:48:23 -03:00

29 lines
800 B
Bash

#!/bin/bash
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# The script may be called from locations other
# than its own folder, so build the full path to
# the script.
if [[ $BASH_SOURCE = '/'* ]]; then
PATH_TO_SCRIPT="$(dirname $BASH_SOURCE)"
else
PATH_TO_SCRIPT="$(pwd)/$(dirname $BASH_SOURCE)"
fi
if [[ "$CONFIG_TYPE" = "platform" ]]; then
SERVICES="system fm openstack dcmanager kubectl helm oidc-auth sw-manager software"
alias "platform_shell"="${PATH_TO_SCRIPT}/client_wrapper.sh /bin/bash"
else
SERVICES="openstack nova cinder glance heat"
alias "application_shell"="${PATH_TO_SCRIPT}/client_wrapper.sh /bin/bash"
fi
for service in $SERVICES; do
alias "$service"="${PATH_TO_SCRIPT}/client_wrapper.sh $service"
done