From c3d8525b44f67c968dbadd2f9ef62249a06b579c Mon Sep 17 00:00:00 2001
From: bcweaver <brianweaver@gmail.com>
Date: Tue, 7 May 2019 13:50:28 -0400
Subject: [PATCH] Change deploy scripts to use terminus to list target sites,
 rather than a manually maintained list

---
 scripts/child_site_list.txt   | 14 --------------
 scripts/deploylive.sh         | 12 +-----------
 scripts/deploytest.sh         | 12 +-----------
 scripts/upstream_apply_dev.sh | 12 +-----------
 4 files changed, 3 insertions(+), 47 deletions(-)
 delete mode 100644 scripts/child_site_list.txt

diff --git a/scripts/child_site_list.txt b/scripts/child_site_list.txt
deleted file mode 100644
index 76762c8f52..0000000000
--- a/scripts/child_site_list.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-ascintranet
-astronomy-d8
-d8-demo-site
-d8-example
-d8-clean-source
-global-arts-and-humanities
-mathematical-biosciences-institute
-migration-target
-ppec
-roy-modern-head
-solar-system
-wonders-of-world
-asctech-d8
-
diff --git a/scripts/deploylive.sh b/scripts/deploylive.sh
index d7ceb9c6a5..7894cff787 100755
--- a/scripts/deploylive.sh
+++ b/scripts/deploylive.sh
@@ -1,15 +1,5 @@
 #!/usr/bin/env bash
 
-if [[ ! -r ./child_site_list.txt ]]; then
-  echo;
-  echo "        ./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 [[ -z "$1" ]]; then
   echo;
   echo "Usage: deploylive.sh <\"Deploy message\">";
@@ -17,7 +7,7 @@
   exit 1;
 fi
 
-for site in `cat child_site_list.txt`; do
+for site in `terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --fields=name --format=string`; do
     echo "Site: [$site]";
     terminus env:deploy ${site}.live --updatedb --cc --note="$1";
 done
diff --git a/scripts/deploytest.sh b/scripts/deploytest.sh
index 7dfde60443..f4a55e0671 100755
--- a/scripts/deploytest.sh
+++ b/scripts/deploytest.sh
@@ -1,15 +1,5 @@
 #!/usr/bin/env bash
 
-if [[ ! -r ./child_site_list.txt ]]; then
-  echo;
-  echo "        ./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 [[ -z "$1" ]]; then
   echo;
   echo "Usage: deploytest.sh <\"Deploy message\">";
@@ -17,7 +7,7 @@
   exit 1;
 fi
 
-for site in `cat child_site_list.txt`; do
+for site in `terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --fields=name --format=string`; do
     echo "Site: [$site]";
     terminus env:deploy ${site}.test --updatedb --cc --note="$1";
 done
diff --git a/scripts/upstream_apply_dev.sh b/scripts/upstream_apply_dev.sh
index e7f7df09b7..b73a7d68d3 100755
--- a/scripts/upstream_apply_dev.sh
+++ b/scripts/upstream_apply_dev.sh
@@ -1,16 +1,6 @@
 #!/usr/bin/env bash
 
-if [[ ! -r ./child_site_list.txt ]]; then
-  echo;
-  echo "        ./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
-
-for site in `cat child_site_list.txt`; do
+for site in `terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --fields=name --format=string`; do
     echo "Site: [$site]";
     terminus site:upstream:clear-cache ${site};
     terminus upstream:updates:list ${site}.dev;
-- 
GitLab