Skip to content

Commit

Permalink
Remove redis scripts (#1480)
Browse files Browse the repository at this point in the history
* Remove redis scripts

* Remove redis scripts

* Remove json file

---------

Co-authored-by: Automatic Update <radix@statoilsrm.onmicrosoft.com>
  • Loading branch information
sveinpj and Automatic Update authored Oct 22, 2024
1 parent be5f63c commit 2c5abbf
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 355 deletions.
14 changes: 7 additions & 7 deletions scripts/aks/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ echo "Done."

WORKDIR_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

printf "\n%s► Execute Redis Cache for QA %s%s\n" "${grn}" "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh" "${normal}"
(RADIX_ZONE_ENV="$RADIX_ZONE_ENV" CLUSTER_NAME="$CLUSTER_NAME" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="$USER_PROMPT" source "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh")
wait # wait for subshell to finish
echo ""
printf "%s► Execute Redis Cache for Prod %s%s\n" "${grn}" "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh" "${normal}"
(RADIX_ZONE_ENV="$RADIX_ZONE_ENV" CLUSTER_NAME="$CLUSTER_NAME" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="$USER_PROMPT" source "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh")
wait # wait for subshell to finish
# printf "\n%s► Execute Redis Cache for QA %s%s\n" "${grn}" "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh" "${normal}"
# (RADIX_ZONE_ENV="$RADIX_ZONE_ENV" CLUSTER_NAME="$CLUSTER_NAME" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="$USER_PROMPT" source "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh")
# wait # wait for subshell to finish
# echo ""
# printf "%s► Execute Redis Cache for Prod %s%s\n" "${grn}" "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh" "${normal}"
# (RADIX_ZONE_ENV="$RADIX_ZONE_ENV" CLUSTER_NAME="$CLUSTER_NAME" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="$USER_PROMPT" source "$WORKDIR_PATH/../redis/delete_redis_cache_for_console.sh")
# wait # wait for subshell to finish

#######################################################################################
### Delete replyUrls
Expand Down
118 changes: 62 additions & 56 deletions scripts/migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ if ! [[ -x "$UPDATE_NETWORKPOLICY_CANARY_SECRET_SCRIPT" ]]; then
echo "ERROR: The update networkpolicy canary secret script is not found or it is not executable in path $UPDATE_NETWORKPOLICY_CANARY_SECRET_SCRIPT" >&2
fi

CREATE_REDIS_CACHE_SCRIPT="$WORKDIR_PATH/redis/create_redis_cache_for_console.sh"
if ! [[ -x "$CREATE_REDIS_CACHE_SCRIPT" ]]; then
# Print to stderror
echo "ERROR: The create redis cache script is not found or it is not executable in path $CREATE_REDIS_CACHE_SCRIPT" >&2
fi
# CREATE_REDIS_CACHE_SCRIPT="$WORKDIR_PATH/redis/create_redis_cache_for_console.sh"
# if ! [[ -x "$CREATE_REDIS_CACHE_SCRIPT" ]]; then
# # Print to stderror
# echo "ERROR: The create redis cache script is not found or it is not executable in path $CREATE_REDIS_CACHE_SCRIPT" >&2
# fi

UPDATE_REDIS_CACHE_SECRET_SCRIPT="$WORKDIR_PATH/redis/update_redis_cache_for_console.sh"
if ! [[ -x "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" ]]; then
Expand Down Expand Up @@ -389,33 +389,33 @@ if [[ ${BACKUP_NAME} == "migration-"* ]]; then
echo ""
fi

create_redis_cache=true
if [[ $USER_PROMPT == true ]]; then
while true; do
read -r -p "Create Redis Caches for Console? (Y/n) " yn
case $yn in
[Yy]*) break ;;
[Nn]*)
create_redis_cache=false
exit 0
;;
*) echo "Please answer yes or no." ;;
esac
done
echo ""
fi
# create_redis_cache=true
# if [[ $USER_PROMPT == true ]]; then
# while true; do
# read -r -p "Create Redis Caches for Console? (Y/n) " yn
# case $yn in
# [Yy]*) break ;;
# [Nn]*)
# create_redis_cache=false
# exit 0
# ;;
# *) echo "Please answer yes or no." ;;
# esac
# done
# echo ""
# fi

if [[ $create_redis_cache == true ]]; then
printf "Creating Redis Caches for Console...\n"
(
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=qa)%s\n" "${grn}" "$CREATE_REDIS_CACHE_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="false" source "$CREATE_REDIS_CACHE_SCRIPT"
echo ""
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=prod)%s\n" "${grn}" "$CREATE_REDIS_CACHE_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="false" source "$CREATE_REDIS_CACHE_SCRIPT"
)
printf "Done...\n"
fi
# if [[ $create_redis_cache == true ]]; then
# printf "Creating Redis Caches for Console...\n"
# (
# printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=qa)%s\n" "${grn}" "$CREATE_REDIS_CACHE_SCRIPT" "${normal}"
# RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="false" source "$CREATE_REDIS_CACHE_SCRIPT"
# echo ""
# printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=prod)%s\n" "${grn}" "$CREATE_REDIS_CACHE_SCRIPT" "${normal}"
# RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="false" source "$CREATE_REDIS_CACHE_SCRIPT"
# )
# printf "Done...\n"
# fi

# Give option to create dest cluster if it does not exist
echo ""
Expand Down Expand Up @@ -726,21 +726,21 @@ printf "\n%s► Execute %s%s\n" "${grn}" "$UPDATE_NETWORKPOLICY_CANARY_SECRET_SC
wait # wait for subshell to finish
echo ""

update_redis_cache=true
if [[ $USER_PROMPT == true ]]; then
while true; do
read -r -p "Update Redis Caches for Console? (Y/n) " yn
case $yn in
[Yy]*) break ;;
[Nn]*)
update_redis_cache=false
exit 0
;;
*) echo "Please answer yes or no." ;;
esac
done
echo ""
fi
# update_redis_cache=true
# if [[ $USER_PROMPT == true ]]; then
# while true; do
# read -r -p "Update Redis Caches for Console? (Y/n) " yn
# case $yn in
# [Yy]*) break ;;
# [Nn]*)
# update_redis_cache=false
# exit 0
# ;;
# *) echo "Please answer yes or no." ;;
# esac
# done
# echo ""
# fi

# Wait for redis caches to be created.
printf "\nWaiting for redis caches to be created..."
Expand All @@ -750,16 +750,22 @@ while [[ $(az redis show --resource-group "$AZ_RESOURCE_GROUP_CLUSTERS" --name "
done
printf " Done\n."

if [[ $update_redis_cache == true ]]; then
printf "Updating Redis Caches for Console...\n"
(
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=qa)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=prod)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"
)
printf "Done...\n"
fi
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=qa)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"
printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=prod)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"


# if [[ $update_redis_cache == true ]]; then
# printf "Updating Redis Caches for Console...\n"
# (
# printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=qa)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
# RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="qa" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"
# printf "%s► Execute %s (RADIX_WEB_CONSOLE_ENV=prod)%s\n" "${grn}" "$UPDATE_REDIS_CACHE_SECRET_SCRIPT" "${normal}"
# RADIX_ZONE_ENV="$RADIX_ZONE_ENV" AUTH_PROXY_COMPONENT="$AUTH_PROXY_COMPONENT" CLUSTER_NAME="$DEST_CLUSTER" RADIX_WEB_CONSOLE_ENV="prod" USER_PROMPT="false" source "$UPDATE_REDIS_CACHE_SECRET_SCRIPT"
# )
# printf "Done...\n"
# fi

# Move custom ingresses
# if [[ $MIGRATION_STRATEGY == "aa" ]]; then
Expand Down
39 changes: 0 additions & 39 deletions scripts/redis/azure_cache_for_redis.json

This file was deleted.

124 changes: 0 additions & 124 deletions scripts/redis/create_redis_cache_for_console.sh

This file was deleted.

Loading

0 comments on commit 2c5abbf

Please sign in to comment.