automated terminal push

This commit is contained in:
lenape
2025-07-12 18:36:46 +00:00
parent 40b0504f57
commit ef7c7c7ca3
3 changed files with 28 additions and 25 deletions

7
Jenkinsfile vendored
View File

@@ -159,7 +159,8 @@ pipeline {
).trim()
echo "EC2 Instance IP: ${ec2_ip}"
writeFile file: 'ansible/hosts', text: "[inventory_hosts]\n${ec2_ip} ansible_user=ubuntu"
// Changed from ubuntu to ec2-user for Amazon Linux
writeFile file: 'ansible/hosts', text: "[inventory_hosts]\n${ec2_ip} ansible_user=ec2-user"
}
ansiblePlaybook(
@@ -226,14 +227,14 @@ pipeline {
returnStdout: true
).trim()
echo "Performing health check on http://${ec2_ip}:8080"
echo "Performing health check on http://${ec2_ip}:8080/health"
// Wait for the service to be available
timeout(time: 5, unit: 'MINUTES') {
waitUntil {
script {
def response = sh(
script: "curl -s -o /dev/null -w '%{http_code}' http://${ec2_ip}:8080 || echo '000'",
script: "curl -s -o /dev/null -w '%{http_code}' http://${ec2_ip}:8080/health || echo '000'",
returnStdout: true
).trim()