diff --git a/scripts/drush_all.sh b/scripts/drush_all.sh new file mode 100644 index 0000000000000000000000000000000000000000..00496b1b0534c2cd2c0d5cd9d6e583e09fe6086c --- /dev/null +++ b/scripts/drush_all.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +# if [[ -z `which parallel` || -z `which tmux` || -z `which gdate` ]]; then +# echo "Either 'parallel' or 'tmux' is not installed..."; +# if [[ -z `which brew` ]]; then +# echo "Homebrew is NOT installed. Homebrew needs to be installed to proceed."; +# echo "Visit https://https://brew.sh/ for more information."; +# exit 1; +# else +# echo "Attempting to install parallel, tmux, coreutils..."; +# brew install parallel tmux coreutils; +# fi +# fi + +if [[ -z $1 || -z $2 ]]; then + echo; echo "Usage: $0 <env> 'drush command'"; + echo; echo; + exit 1; +fi + +# ENV=$1; +# shift; + +# if [[ $ENV == 'test' || $ENV == 'live' ]]; then +# if [[ -z $1 ]]; then +# while [[ -z $DEPLOY_MSG ]]; do +# echo; +# read -p "Enter deployment message: " DEPLOY_MSG; +# echo; +# done +# else +# DEPLOY_MSG=$@; +# fi +# fi + +# NOW=`date +%Y%m%d_%H%M`; +# LOG_DIR="deploy-$ENV-$NOW"; +# mkdir $LOG_DIR; +# echo "LOG_DIR: $LOG_DIR"; + +SITES=$(terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --fields=name --format=string | sort); + +# for site in $SITES; do +# echo "site: $site"; +# done + + +parallel --delay 0.1 --tag "terminus remote:drush {}.$1 $2" ::: $SITES + +# echo $SITES | parallel --delay 0.1 "terminus remote:drush {prohibition}.live pmpi piwik_reports -- --format=table --fields=status,name --no-field-labels 2>/dev/null"; + + +# parallel --delay 0.1 --tmuxpane --fg -a $LOG_DIR/site_list.txt "scripts/deploy-site-env.sh {}.$ENV $DEPLOY_MSG 2>&1 | tee $LOG_DIR/{}.log"; + +# echo; echo; echo "Sleeping for 11 seconds..."; echo; echo; +# sleep 11; + +# reset; + +# wait; + +# cd $LOG_DIR; +# wc -l * | sort -n | tee line-counts.txt; +# cd ..; + +# echo; echo; echo "Sleeping for 11 more seconds..."; echo; echo; +# sleep 11; diff --git a/scripts/login_all.sh b/scripts/login_all.sh index a8d18740a08da0595ee2e96a4a5b6b503251148a..bb9208f8ea1a6ba2b508d5788459f2f8d08a2b4e 100644 --- a/scripts/login_all.sh +++ b/scripts/login_all.sh @@ -2,15 +2,15 @@ pwd -if [[ ! -r ./scripts/child_site_list.txt ]]; then - echo; - echo " ./scripts/child_site_list.txt is missing or not readable."; - echo; - echo " Make sure you're executing this script from a location from which"; - echo " that relative path is available."; - echo; - exit 1; -fi +# if [[ ! -r ./scripts/child_site_list.txt ]]; then +# echo; +# echo " ./scripts/child_site_list.txt is missing or not readable."; +# echo; +# echo " Make sure you're executing this script from a location from which"; +# echo " that relative path is available."; +# echo; +# exit 1; +# fi COOKIE_DIR="`realpath ~/.curl_cookies`"; #echo "Cookie dir: $COOKIE_DIR"; @@ -48,7 +48,10 @@ CURL_COMMAND="curl -ksSL -c $COOKIE_JAR -b $COOKIE_JAR -w '%{http_code} %{url_effective}' -o /dev/null"; -for site in `cat scripts/child_site_list.txt`; do +SITES=$(terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --tag=D8 --fields=name --format=string | sort); +echo $SITES; + +for site in $SITES; do ULI_CMD="terminus remote:drush ${site}.${ENV} uli"; #echo "ULI_CMD: $ULI_CMD"; diff --git a/scripts/query_all.sh b/scripts/query_all.sh new file mode 100644 index 0000000000000000000000000000000000000000..79436bfd2087e884a32e5589feecb0269960d2fa --- /dev/null +++ b/scripts/query_all.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +# if [[ -z `which parallel` || -z `which tmux` || -z `which gdate` ]]; then +# echo "Either 'parallel' or 'tmux' is not installed..."; +# if [[ -z `which brew` ]]; then +# echo "Homebrew is NOT installed. Homebrew needs to be installed to proceed."; +# echo "Visit https://https://brew.sh/ for more information."; +# exit 1; +# else +# echo "Attempting to install parallel, tmux, coreutils..."; +# brew install parallel tmux coreutils; +# fi +# fi + +if [[ -z $1 ]]; then + echo; echo "Usage: $0 \"query\""; + echo; echo; + exit 1; +fi + + +mysql-pantheon () +{ + if [[ -z $1 ]]; then + echo "Usage: mysql-pantheon <site.env>"; + echo; + return; + fi; + terminus env:wake $1; + `terminus connection:info --fields=mysql_command --format=string $1;` +} + +# ENV=$1; +# shift; + +# if [[ $ENV == 'test' || $ENV == 'live' ]]; then +# if [[ -z $1 ]]; then +# while [[ -z $DEPLOY_MSG ]]; do +# echo; +# read -p "Enter deployment message: " DEPLOY_MSG; +# echo; +# done +# else +# DEPLOY_MSG=$@; +# fi +# fi + +# NOW=`date +%Y%m%d_%H%M`; +# LOG_DIR="deploy-$ENV-$NOW"; +# mkdir $LOG_DIR; +# echo "LOG_DIR: $LOG_DIR"; + +export -f mysql-pantheon; + +SITES=$(terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --fields=name --format=string | sort); + +parallel --tag "echo \"$1\" | mysql-pantheon {}.live" ::: $SITES + +# for site in $SITES; do +# echo "=== $site ==="; + +# # echo "select nid, cid, name from webform_component where type = 'file' and extra like '%html%';" | `terminus connection:info --fields=mysql_command --format=string ${site}.live;` + +# echo "$1" | mysql-pantheon ${site}.live; + +# echo;echo; +# done + + +# parallel --delay 0.1 --tag "terminus remote:drush {}.live pmi $1 -- --format=table --fields=status,extension --no-field-labels 2>/dev/null" ::: $SITES + +# echo $SITES | parallel --delay 0.1 "terminus remote:drush {prohibition}.live pmpi piwik_reports -- --format=table --fields=status,name --no-field-labels 2>/dev/null"; + + +# parallel --delay 0.1 --tmuxpane --fg -a $LOG_DIR/site_list.txt "scripts/deploy-site-env.sh {}.$ENV $DEPLOY_MSG 2>&1 | tee $LOG_DIR/{}.log"; + +# echo; echo; echo "Sleeping for 11 seconds..."; echo; echo; +# sleep 11; + +# reset; + +# wait; + +# cd $LOG_DIR; +# wc -l * | sort -n | tee line-counts.txt; +# cd ..; + +# echo; echo; echo "Sleeping for 11 more seconds..."; echo; echo; +# sleep 11;