From dd0fc32b02c47402f284646d1a2fab355635eead Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 30 Jun 2020 07:47:58 -0500 Subject: [PATCH] Ensure cloud-init has finished running We need to wait for cloud-init to be completely finished since it is registering RHEL instances with RHN and preparing a swap file. Signed-off-by: Major Hayden --- schutzbot/Jenkinsfile | 1 + schutzbot/ci_details.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile index 78a7cbda4..b893dcf35 100644 --- a/schutzbot/Jenkinsfile +++ b/schutzbot/Jenkinsfile @@ -84,6 +84,7 @@ pipeline { AWS_CREDS = credentials('aws-credentials-osbuildci') } steps { + sh "schutzbot/ci_details.sh" sh "schutzbot/mockbuild.sh" stash ( includes: 'osbuild-mock.repo', diff --git a/schutzbot/ci_details.sh b/schutzbot/ci_details.sh index b8d10f188..28879ef86 100755 --- a/schutzbot/ci_details.sh +++ b/schutzbot/ci_details.sh @@ -30,3 +30,13 @@ echo -e "\033[0m" echo "List of installed packages:" rpm -qa | sort echo "------------------------------------------------------------------------------" + +# Ensure cloud-init has completely finished on the instance. This ensures that +# the instance is fully ready to go. +while true; do + if [[ -f /var/lib/cloud/instance/boot-finished ]]; then + break + fi + echo -e "\n🤔 Waiting for cloud-init to finish running..." + sleep 5 +done