parent
dd9444b036
commit
7223dca951
27
abra
27
abra
@ -158,8 +158,7 @@ sub_help() {
|
||||
echo " deploy let 'em rip"
|
||||
echo " logs SERVICE [ARGS] tail logs from a deployed service"
|
||||
echo " multilogs tail logs from a whole stackk"
|
||||
echo " run SERVICE CMD run a command in the specified service's container"
|
||||
echo " run_args SERVICE ARGS CMD run, passing extra args to docker exec"
|
||||
echo " run [-u USER] SERVICE CMD run a command in the specified service's container"
|
||||
echo " secret [--help] [SUBCOMMAND] manage secrets"
|
||||
echo " upgrade upgrade to the latest version"
|
||||
echo " ... (custom commands)"
|
||||
@ -217,16 +216,20 @@ sub_secret() {
|
||||
|
||||
###### Subcommand `run`
|
||||
|
||||
sub_run_args(){
|
||||
sub_run(){
|
||||
require_stack
|
||||
|
||||
SERVICE=$1
|
||||
DOCKER_ARGS=$2
|
||||
|
||||
if [ "$1" == "-u" ]; then
|
||||
RUN_USER="-u $2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
SERVICE=$1
|
||||
|
||||
shift
|
||||
|
||||
if [ -z "$SERVICE" ]; then
|
||||
echo "Usage: $PROGRAM_NAME run SERVICE DOCKER_ARGS [CMD]"
|
||||
echo "Usage: $PROGRAM_NAME run [-u USER] SERVICE [CMD]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -239,19 +242,11 @@ sub_run_args(){
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
docker exec $DOCKER_ARGS -it "$CONTAINER" "$@"
|
||||
docker exec $RUN_USER -it "$CONTAINER" "$@"
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
sub_run(){
|
||||
SERVICE=$1
|
||||
|
||||
shift
|
||||
|
||||
sub_run_args "$SERVICE" "" "$@"
|
||||
}
|
||||
|
||||
###### Subcommand `deploy`
|
||||
|
||||
sub_deploy (){
|
||||
|
Loading…
Reference in New Issue
Block a user