01dcedd72968b8c72288fbd736032ca902bb0426 dschmelt Wed Sep 7 13:48:54 2022 -0700 Adding useful script to git, No RM diff --git src/utils/qa/hubPublicUrlChanger src/utils/qa/hubPublicUrlChanger new file mode 100755 index 0000000..b283f33 --- /dev/null +++ src/utils/qa/hubPublicUrlChanger @@ -0,0 +1,63 @@ +# bin/bash +# hubUrlChanger +# Daniel Schmelter 1/13/22 +# This script is used when a publicHub contributor asks to swap their hubUrl. +# +echo -e "\nCaution, this script will update hubPublic tabe on Dev, Beta, and RR" +echo -e "It is to be used when you want to change a hubUrl entry in hubPublic\n" +echo -e "This script assumes that the current/old hub URL at least has a unique shortLabel" + +read -p 'Enter the old hubPublic shortLabel: ' shLabel +read -p 'Enter the new URL: ' newUrl + +#DEV +echo "Checking hubPublic before DEV update" +hgsql -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentraltest +while true +do + read -r -p 'Continue? Y or y accepted: ' choiceDev + case "$choiceDev" in + y|Y) break ;; + *) echo 'Response not valid';; + esac +done + +hgsql -e "update hubPublic set hubUrl='$newUrl' where shortLabel='$shLabel';" hgcentraltest +hgsql -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentraltest +echo "" + +#BETA +echo "Checking hubPublic before BETA update" +hgsql -h hgwbeta -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentralbeta +while true +do + read -r -p 'Continue? Y or y accepted: ' choiceBeta + case "$choiceBeta" in + y|Y) break ;; + *) echo 'Response not valid';; + esac +done + +echo "Update and check hubPublic hubUrl" +hgsql -h hgwbeta -e "update hubPublic set hubUrl='$newUrl' where shortLabel='$shLabel';" hgcentralbeta +hgsql -h hgwbeta -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentralbeta +echo "" + +#RR +echo "Checking hubPublic before RR update" +hgsql -h genome-centdb -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentral +while true +do + read -r -p 'Continue? Y or y accepted: ' choiceRr + case "$choiceRr" in + y|Y) break ;; + *) echo 'Response not valid';; + esac +done + + +echo "Update and check hubPublic hubUrl" +hgsql -h genome-centdb -e "update hubPublic set hubUrl='$newUrl' where shortLabel='$shLabel';" hgcentral +hgsql -h genome-centdb -e "select * from hubPublic where shortLabel='$shLabel'\G" hgcentral + +echo "You are DONE!"