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 "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:
'''
}
}
}
}
}