automated terminal push

This commit is contained in:
lenape
2025-08-03 04:23:37 +00:00
parent 5b0d882912
commit 942dbfec9e

View File

@@ -75,24 +75,24 @@ pipeline {
echo "Authentication: Jenkins Credential Store (Enterprise Standard)" echo "Authentication: Jenkins Credential Store (Enterprise Standard)"
echo "Build: #${BUILD_NUMBER}" echo "Build: #${BUILD_NUMBER}"
echo "Working Directory: ${env.TF_WORKING_DIR}" echo "Working Directory: ${env.TF_WORKING_DIR}"
// Clean workspace and checkout latest code // Clean workspace and checkout latest code
deleteDir() deleteDir()
checkout scm checkout scm
// Verify repository structure // Verify repository structure
script { script {
sh ''' sh '''
echo "Repository structure validation:" echo "Repository structure validation:"
# Check for required directory # Check for required directory
if [ ! -d "${TF_WORKING_DIR}" ]; then if [ ! -d "${TF_WORKING_DIR}" ]; then
echo "❌ Missing foundation directory: ${TF_WORKING_DIR}" echo "❌ Missing foundation directory: ${TF_WORKING_DIR}"
exit 1 exit 1
fi fi
cd "${TF_WORKING_DIR}" cd "${TF_WORKING_DIR}"
# 1⃣ Core Terraform files (always required) # 1⃣ Core Terraform files (always required)
for file in main.tf variables.tf outputs.tf versions.tf; do for file in main.tf variables.tf outputs.tf versions.tf; do
if [ ! -f "$file" ]; then if [ ! -f "$file" ]; then
@@ -101,30 +101,30 @@ pipeline {
fi fi
echo "✅ Found: $file" echo "✅ Found: $file"
done done
# 2⃣ Bootstrap & cleanup scripts (only if ACTION≠plan AND SKIP_BOOTSTRAP=false) # 2⃣ Bootstrap & cleanup scripts (only if ACTION≠plan AND SKIP_BOOTSTRAP=false)
if [ "${ACTION}" != "plan" ] && [ "${SKIP_BOOTSTRAP}" != "true" ]; then if [ "${ACTION}" != "plan" ] && [ "${SKIP_BOOTSTRAP}" != "true" ]; then
for file in bootstrap.sh cleanup.sh; do for file in bootstrap.sh cleanup.sh; do
if [ ! -f "$file" ]; then if [ ! -f "$file" ]; then
echo "❌ Missing required file: $file" echo "❌ Missing required file: $file"
exit 1 exit 1
fi fi
echo "✅ Found: $file" echo "✅ Found: $file"
done done
else else
echo "✅ Skipping bootstrap/cleanup checks (ACTION=${ACTION}, SKIP_BOOTSTRAP=${SKIP_BOOTSTRAP})" echo "✅ Skipping bootstrap/cleanup checks (ACTION=${ACTION}, SKIP_BOOTSTRAP=${SKIP_BOOTSTRAP})"
fi fi
# Make scripts executable (if they aren't already) # Make scripts executable (if they aren't already)
chmod +x bootstrap.sh cleanup.sh || { chmod +x bootstrap.sh cleanup.sh || {
echo "⚠️ Could not make scripts executable, but continuing..." echo "⚠️ Could not make scripts executable, but continuing..."
} }
echo "✅ Repository structure validated" echo "✅ Repository structure validated"
''' '''
} } // end script
} } // end steps
} } // end stage
stage('🔧 Setup Tools') { stage('🔧 Setup Tools') {
steps { steps {
@@ -873,5 +873,4 @@ Type 'DESTROY' exactly to confirm:
''' '''
} }
} }
} }
}