74
74
- name : Deploy sample app via terraform and wait for endpoint to come online
75
75
working-directory : terraform/ec2
76
76
run : |
77
- # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online.
78
- # There may be occasional failures due to transitivity issues, so try up to 2 times.
77
+ # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online.
78
+ # There may be occasional failures due to transitivity issues, so try up to 2 times.
79
79
# deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates
80
80
# that it failed at some point
81
81
retry_counter=0
@@ -91,11 +91,11 @@ jobs:
91
91
-var="get_cw_agent_rpm_command=${{ env.GET_CW_AGENT_RPM_COMMAND }}" \
92
92
-var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" \
93
93
|| deployment_failed=$?
94
-
94
+
95
95
if [ $deployment_failed -eq 1 ]; then
96
96
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
97
97
fi
98
-
98
+
99
99
# If the deployment_failed is still 0, then the terraform deployment succeeded and now try to connect to the endpoint.
100
100
# Attempts to connect will be made for up to 10 minutes
101
101
if [ $deployment_failed -eq 0 ]; then
@@ -109,12 +109,12 @@ jobs:
109
109
deployment_failed=1
110
110
break
111
111
fi
112
-
112
+
113
113
printf '.'
114
114
attempt_counter=$(($attempt_counter+1))
115
115
sleep 10
116
116
done
117
-
117
+
118
118
echo "Attempting to connect to the remote sample app endpoint"
119
119
remote_sample_app_endpoint=http://$(terraform output sample_app_remote_service_public_ip):8080/healthcheck
120
120
attempt_counter=0
@@ -125,26 +125,26 @@ jobs:
125
125
deployment_failed=1
126
126
break
127
127
fi
128
-
128
+
129
129
printf '.'
130
130
attempt_counter=$(($attempt_counter+1))
131
131
sleep 10
132
132
done
133
133
fi
134
-
134
+
135
135
# If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the
136
136
# resources created from terraform and try again.
137
137
if [ $deployment_failed -eq 1 ]; then
138
138
echo "Destroying terraform"
139
139
terraform destroy -auto-approve \
140
- -var="test_id=${{ env.TESTING_ID }}"
141
-
140
+ -var="test_id=${{ env.TESTING_ID }}"
141
+
142
142
retry_counter=$(($retry_counter+1))
143
143
else
144
144
# If deployment succeeded, then exit the loop
145
145
break
146
146
fi
147
-
147
+
148
148
if [ $retry_counter -eq $max_retry ]; then
149
149
echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code"
150
150
exit 1
@@ -171,6 +171,12 @@ jobs:
171
171
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/remote-service?ip=${{ env.REMOTE_SERVICE_IP }}/
172
172
curl -S -s http://${{ env.MAIN_SERVICE_ENDPOINT }}/client-call/
173
173
174
+ - name : Initiate Gradlew Daemon
175
+ uses : ./.github/workflows/actions/execute_and_retry
176
+ with :
177
+ command : " ./gradlew"
178
+ cleanup : " ./gradlew clean"
179
+
174
180
# Validation for pulse telemetry data
175
181
- name : Validate generated EMF logs
176
182
id : log-validation
0 commit comments