Skip to content
Snippets Groups Projects
Unverified Commit 17d7af4f authored by briancanini's avatar briancanini Committed by GitHub
Browse files

Merge pull request #96 from ASCWebServices/gitignore_sitefiles

Gitignore sitefiles and login-all.sh
parents b3800da5 04d9d2da
No related branches found
No related tags found
No related merge requests found
......@@ -8,13 +8,13 @@
###
# Ignore Drupal's file directory
web/sites/default/files
web/sites/*/files
# Pantheon commits a settings.php for environment-specific settings.
# Place local settings in settings.local.php
#web/sites/*/settings.local.php
web/sites/*/services*.yml
!web/sites/*/services.pantheon.*.yml
!web/sites/*/services.pantheon.*.yml
# Ignore SimpleTest multi-site environment.
web/sites/simpletest
......
#!/usr/bin/env bash
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
COOKIE_DIR="`realpath ~/.curl_cookies`";
#echo "Cookie dir: $COOKIE_DIR";
# Check cookie jar folder
if [[ ! -d "$COOKIE_DIR" ]]; then
echo "COOKIE_DIR doesn't exist. Creating it..";
mkdir $COOKIE_DIR;
fi
# Determine environment
if [[ -z $1 ]]; then
echo "No environment specified.";
echo;
echo "Usage: $0 <dev|test|live>";
echo;
exit 1;
else
if [[ ! "$1" == "dev" && ! "$1" == "test" && ! "$1" == "live" ]]; then
echo "'$1' is not a valid environment.";
echo;
echo "Usage $0 <dev|test|live>";
echo;
exit 1;
else
ENV="$1";
fi
fi
TODAYS_DATE="`date +%Y-%m-%d`";
COOKIE_JAR="$COOKIE_DIR/homepage_status_checks-$TODAYS_DATE.txt";
echo "Cookie jar: $COOKIE_JAR";
echo;
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
ULI_CMD="terminus remote:drush ${site}.${ENV} uli";
#echo "ULI_CMD: $ULI_CMD";
DRUSH_ULI="`$ULI_CMD`";
#echo "DRUSH_ULI: $DRUSH_ULI";
if [[ "$ENV" != "prod" ]]; then
terminus env:wake ${site}.${ENV};
fi
CURL_LOGIN="$CURL_COMMAND '$DRUSH_ULI'";
#echo "curl login command: $CURL_LOGIN";
RESPONSE=$(eval $CURL_LOGIN);
#echo "response: $RESPONSE";
HTTP_CODE=`echo "$RESPONSE" | cut -d' ' -f 1`;
URL_EFFECTIVE=`echo "$RESPONSE" | cut -d' ' -f 2`;
#echo "status code: $HTTP_CODE";
#echo "url: $URL_EFFECTIVE";
if [[ "$HTTP_CODE" == "200" ]]; then
echo -e "\e[92m OK $URL_EFFECTIVE \e[0m"
else
echo -e "\e[91m ###################################### \e[0m";
echo -e "\e[91m \e[5mError:\e[25m $HTTP_CODE $URL_EFFECTIVE \e[0m";
fi
# RESPONSE=`curl -ksSL -w "%{http_code} %{url_effective}" -o /dev/null ${SITE}`;
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment