automated terminal push
This commit is contained in:
21
infrastructure/foundation/Jenkinsfile
vendored
21
infrastructure/foundation/Jenkinsfile
vendored
@@ -132,14 +132,24 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
// Verify Terraform is available
|
// Verify Terraform is available
|
||||||
sh '''
|
sh '''
|
||||||
echo "✅ Checking for Terraform..."
|
echo "=== Tool Validation ==="
|
||||||
if command -v terraform > /dev/null 2>&1; then
|
|
||||||
echo "❌ Terraform not found. Please install Terraform ${TF_VERSION}"
|
# Validate Terraform with version check
|
||||||
|
if terraform version > /dev/null 2>&1; then
|
||||||
|
TF_VERSION_ACTUAL=$(terraform version | head -n1 | cut -d' ' -f2 | sed 's/^v//')
|
||||||
|
echo "✅ Terraform found: v${TF_VERSION_ACTUAL}"
|
||||||
|
|
||||||
|
# Ensure minimum version
|
||||||
|
if [ "${TF_VERSION_ACTUAL}" != "${TF_VERSION}" ]; then
|
||||||
|
echo "⚠️ Note: Expected v${TF_VERSION}, found v${TF_VERSION_ACTUAL}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "❌ Terraform not found (required: v${TF_VERSION})"
|
||||||
|
echo " Install: https://releases.hashicorp.com/terraform/${TF_VERSION}/"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✅ Terraform is already installed"
|
echo "=== Tool Validation Complete ==="
|
||||||
terraform version
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
// Verify AWS credentials and permissions via Jenkins credential store
|
// Verify AWS credentials and permissions via Jenkins credential store
|
||||||
@@ -189,6 +199,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('🔍 SonarQube Analysis') {
|
stage('🔍 SonarQube Analysis') {
|
||||||
when {
|
when {
|
||||||
allOf {
|
allOf {
|
||||||
|
|||||||
Reference in New Issue
Block a user