jenkins/build-seed: simplify and fix shellcheck errors
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib70c659d22ed027bcffe936f7c273cafac3a195b
diff --git a/jenkins/build-seed b/jenkins/build-seed
index cb68b5f..9e30a07 100755
--- a/jenkins/build-seed
+++ b/jenkins/build-seed
@@ -12,36 +12,16 @@
export LANG=en_US.UTF8
-cd ${WORKSPACE}
+cd "${WORKSPACE}"
git clone https://github.com/openbmc/openbmc.git
# Ensure everything is built on same filesystem
-export build_dir=${WORKSPACE}/build
+export build_dir="${WORKSPACE}/build"
-export target=rainier
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=gsj
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=palmetto
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=romulus
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=witherspoon
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=tiogapass
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
-
-export target=zaius
-${WORKSPACE}/openbmc-build-scripts/build-setup.sh
-rm -rf ${WORKSPACE}/openbmc/build
+SEED_MACHINES=( rainier gsj palmetto romulus witherspoon tiogapass zaius )
+for m in "${SEED_MACHINES[@]}"; do
+ echo "Seeding $m"
+ export target=$m
+ "${WORKSPACE}/openbmc-build-scripts/build-setup.sh"
+ rm -rf "${WORKSPACE}/openbmc/build"
+done