automated terminal push
This commit is contained in:
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user