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