From 942dbfec9e5b4a9bfe922e7f0f1def5a76b95443 Mon Sep 17 00:00:00 2001 From: lenape Date: Sun, 3 Aug 2025 04:23:37 +0000 Subject: [PATCH] automated terminal push --- infrastructure/foundation/Jenkinsfile | 41 +++++++++++++-------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/infrastructure/foundation/Jenkinsfile b/infrastructure/foundation/Jenkinsfile index b685cda..dafc79f 100644 --- a/infrastructure/foundation/Jenkinsfile +++ b/infrastructure/foundation/Jenkinsfile @@ -75,24 +75,24 @@ pipeline { echo "Authentication: Jenkins Credential Store (Enterprise Standard)" echo "Build: #${BUILD_NUMBER}" echo "Working Directory: ${env.TF_WORKING_DIR}" - + // Clean workspace and checkout latest code deleteDir() checkout scm - + // Verify repository structure script { sh ''' echo "Repository structure validation:" - + # Check for required directory if [ ! -d "${TF_WORKING_DIR}" ]; then echo "❌ Missing foundation directory: ${TF_WORKING_DIR}" exit 1 fi - + cd "${TF_WORKING_DIR}" - + # 1️⃣ Core Terraform files (always required) for file in main.tf variables.tf outputs.tf versions.tf; do if [ ! -f "$file" ]; then @@ -101,30 +101,30 @@ pipeline { fi echo "✅ Found: $file" done - + # 2️⃣ Bootstrap & cleanup scripts (only if ACTION≠plan AND SKIP_BOOTSTRAP=false) if [ "${ACTION}" != "plan" ] && [ "${SKIP_BOOTSTRAP}" != "true" ]; then - for file in bootstrap.sh cleanup.sh; do - if [ ! -f "$file" ]; then - echo "❌ Missing required file: $file" - exit 1 - fi - echo "✅ Found: $file" - done + for file in bootstrap.sh cleanup.sh; do + if [ ! -f "$file" ]; then + echo "❌ Missing required file: $file" + exit 1 + fi + echo "✅ Found: $file" + done else - echo "✅ Skipping bootstrap/cleanup checks (ACTION=${ACTION}, SKIP_BOOTSTRAP=${SKIP_BOOTSTRAP})" + echo "✅ Skipping bootstrap/cleanup checks (ACTION=${ACTION}, SKIP_BOOTSTRAP=${SKIP_BOOTSTRAP})" fi - + # Make scripts executable (if they aren't already) chmod +x bootstrap.sh cleanup.sh || { echo "⚠️ Could not make scripts executable, but continuing..." } - + echo "✅ Repository structure validated" ''' - } - } - } + } // end script + } // end steps + } // end stage stage('🔧 Setup Tools') { steps { @@ -873,5 +873,4 @@ Type 'DESTROY' exactly to confirm: ''' } } - } -} \ No newline at end of file + } \ No newline at end of file