##// END OF EJS Templates
rccontrol: fixed cli commands
super-admin -
Show More
@@ -2,15 +2,15 b''
2 set -euo pipefail
2 set -euo pipefail
3 IFS=$'\n\t'
3 IFS=$'\n\t'
4
4
5 #docker image tag 94977371485a rhodecode/app_source:4.27.0.DEV_BUILD
6 #export RC_VERSION="4.28.0.REL20221120_SOURCE"
5 #export RC_VERSION="4.28.0.REL20221120_SOURCE"
6 #docker image tag 94977371485a rhodecode/rhodecode-ee:4.27.0.DEV_BUILD
7
7
8
8
9 usage="$(basename "$0") ./dev.sh <COMMAND> -- run docker command
9 usage="$(basename "$0") ./dev.sh <COMMAND> -- run docker command
10 where <COMMAND>:
10 where <COMMAND>:
11 [v]cs -- run bash console for vcsserver
11 v|vcs -- run bash console for vcsserver
12 [r]c -- run bash console for rhodecode-ee
12 e|ee -- run bash console for rhodecode-ee
13 ce -- run bash console for rhodecode-ce
13 c|ce -- run bash console for rhodecode-ce
14 dev-env -- create dev env required to run vcsserver and rhodecode
14 dev-env -- create dev env required to run vcsserver and rhodecode
15 "
15 "
16
16
@@ -20,11 +20,11 b' case ${1:-} in'
20 eval "(docker stop dev-vcsserver || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run --service-ports --rm --use-aliases --workdir="/home/rhodecode/rhodecode-vcsserver" --name="dev-vcsserver" vcsserver bash"
20 eval "(docker stop dev-vcsserver || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run --service-ports --rm --use-aliases --workdir="/home/rhodecode/rhodecode-vcsserver" --name="dev-vcsserver" vcsserver bash"
21 exit
21 exit
22 ;;
22 ;;
23 r|rc )
23 e|ee )
24 eval "(docker stop dev-enterprise-ee || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run -e RC_APP_TYPE=rhodecode_bash --publish 10020:10020 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ee" --name="dev-enterprise-ee" rhodecode bash"
24 eval "(docker stop dev-enterprise-ee || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run -e RC_APP_TYPE=rhodecode_bash --publish 10020:10020 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ee" --name="dev-enterprise-ee" rhodecode bash"
25 exit
25 exit
26 ;;
26 ;;
27 ce )
27 c|ce )
28 eval "(docker stop dev-enterprise-ce || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run --publish 10022:10020 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ce" --name="dev-enterprise-ce" rhodecode bash"
28 eval "(docker stop dev-enterprise-ce || echo skip-stop ) && ./rccontrol stack rhodecode -f docker-compose-apps.dev.yaml run --publish 10022:10020 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ce" --name="dev-enterprise-ce" rhodecode bash"
29 exit
29 exit
30 ;;
30 ;;
@@ -731,7 +731,7 b' rccontrol_cli_usage() {'
731 echo " redis CLI for Redis"
731 echo " redis CLI for Redis"
732 echo " db CLI with Database connection"
732 echo " db CLI with Database connection"
733 echo " db-upgrade CLI to run db upgrade"
733 echo " db-upgrade CLI to run db upgrade"
734 echo " storage CLI for repository storage"
734 echo " storage CLI for repository storage. Exposes a basic image with mounted data and repositories volumes"
735 echo
735 echo
736
736
737 # :command.long_usage
737 # :command.long_usage
@@ -836,11 +836,11 b' rccontrol_cli_db_upgrade_usage() {'
836 # :command.usage
836 # :command.usage
837 rccontrol_cli_storage_usage() {
837 rccontrol_cli_storage_usage() {
838 if [[ -n $long_usage ]]; then
838 if [[ -n $long_usage ]]; then
839 printf "rccontrol cli storage - CLI for repository storage\n"
839 printf "rccontrol cli storage - CLI for repository storage. Exposes a basic image with mounted data and repositories volumes\n"
840 echo
840 echo
841
841
842 else
842 else
843 printf "rccontrol cli storage - CLI for repository storage\n"
843 printf "rccontrol cli storage - CLI for repository storage. Exposes a basic image with mounted data and repositories volumes\n"
844 echo
844 echo
845
845
846 fi
846 fi
@@ -2071,12 +2071,24 b' rccontrol_cli_db_command() {'
2071 exit
2071 exit
2072 fi
2072 fi
2073
2073
2074 .env --file $RUNTIME_ENV
2075
2076 .env get DB_PASSWORD
2077 DB_PASSWORD=$REPLY
2078
2079 .env get DB_NAME
2080 DB_NAME=$REPLY
2081
2082 .env get DB_USER
2083 DB_USER=$REPLY
2084
2074 if [[ $DEBUG ]]; then
2085 if [[ $DEBUG ]]; then
2075 echo "Running |docker exec --interactive --tty $docker_id $CMD|"
2086 echo "Running |docker exec --env-file $RUNTIME_ENV --interactive --tty $docker_id $CMD|"
2076 echo "docker exec --interactive --tty $docker_id /bin/bash -c 'PGPASSWORD=$DB_PASSWORD psql --username=$DB_USER --dbname=$DB_NAME'"
2087 echo "docker exec --interactive --tty $docker_id /bin/bash -c 'PGPASSWORD=$DB_PASSWORD psql --username=$DB_USER --dbname=$DB_NAME'"
2077 fi
2088 fi
2078
2089
2079 eval "docker exec --interactive --tty $docker_id /bin/bash -c 'PGPASSWORD=$DB_PASSWORD psql --username=$DB_USER --dbname=$DB_NAME'"
2090 echo
2091 eval "docker exec --env-file $RUNTIME_ENV --interactive --tty $docker_id /bin/bash -c 'PGPASSWORD=$DB_PASSWORD psql --username=$DB_USER --dbname=$DB_NAME'"
2080
2092
2081 }
2093 }
2082
2094
@@ -2116,7 +2128,6 b' rccontrol_cli_storage_command() {'
2116 DEBUG=${args[--debug]}
2128 DEBUG=${args[--debug]}
2117 ENV_FILE=${args[--env-file-path]}
2129 ENV_FILE=${args[--env-file-path]}
2118
2130
2119 source $ENV_FILE
2120 target_container=$RC_IMAGE_EE
2131 target_container=$RC_IMAGE_EE
2121
2132
2122 image_id=$(docker image ls $RC_IMAGE_EE -q)
2133 image_id=$(docker image ls $RC_IMAGE_EE -q)
@@ -2133,8 +2144,8 b' rccontrol_cli_storage_command() {'
2133 echo "rc_datavolume inspection..."
2144 echo "rc_datavolume inspection..."
2134 docker volume inspect rc_datavolume
2145 docker volume inspect rc_datavolume
2135
2146
2136 echo "rhodecode_repos inspection..."
2147 echo "rc_reposvolume inspection..."
2137 docker volume inspect rhodecode_repos
2148 docker volume inspect rc_reposvolume
2138 fi
2149 fi
2139
2150
2140 #
2151 #
@@ -3799,6 +3810,9 b' initialize() {'
3799 # bootstrap file is a config file at the same time
3810 # bootstrap file is a config file at the same time
3800 CONFIG_FILE=${RCC_CONFIG:=.rccontrol.ini}
3811 CONFIG_FILE=${RCC_CONFIG:=.rccontrol.ini}
3801
3812
3813 # runtime env file
3814 RUNTIME_ENV=$PWD/.custom/.runtime.env
3815
3802 # STACK_LIST
3816 # STACK_LIST
3803 VALID_SERVICES="router metrics services rhodecode"
3817 VALID_SERVICES="router metrics services rhodecode"
3804 DOCKER_DEFS_WORK_DIR="docker_defs"
3818 DOCKER_DEFS_WORK_DIR="docker_defs"
General Comments 0
You need to be logged in to leave comments. Login now