Skip to content

Commit

Permalink
Bash test on gradle agents
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Nov 1, 2024
1 parent d6e0d54 commit fb24c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vars/publishGradleCheckTestResults.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void indexFailedTestData() {
else
echo "Index does not exist. Creating..."
create_index_response=\$(curl -s -XPUT "${METRICS_HOST_URL}/\${INDEX_NAME}" --aws-sigv4 \"aws:amz:us-east-1:es\" --user \"${awsAccessKey}:${awsSecretKey}\" -H \"x-amz-security-token:${awsSessionToken}\" -H 'Content-Type: application/json' -d "\${INDEX_MAPPING}")
if [[ \$create_index_response == *'"acknowledged":true'* ]]; then
if [ \$create_index_response == *'"acknowledged":true'* ]; then
echo "Index created successfully."
echo "Updating alias..."
update_alias_response=\$(curl -s -XPOST "${METRICS_HOST_URL}/_aliases" --aws-sigv4 \"aws:amz:us-east-1:es\" --user \"${awsAccessKey}:${awsSecretKey}\" -H \"x-amz-security-token:${awsSessionToken}\" -H "Content-Type: application/json" -d '{
Expand All @@ -186,7 +186,7 @@ void indexFailedTestData() {
}
]
}')
if [[ \$update_alias_response == *'"acknowledged":true'* ]]; then
if [ \$update_alias_response == *'"acknowledged":true'* ]; then
echo "Alias updated successfully."
else
echo "Failed to update alias. Error message: \$update_alias_response"
Expand Down
4 changes: 2 additions & 2 deletions vars/publishIntegTestResults.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void indexTestFailuresData(testFailuresindexName, testFailuresFile) {
else
echo "Index does not exist. Creating..."
create_index_response=\$(curl -s -XPUT "${METRICS_HOST_URL}/${testFailuresindexName}" --aws-sigv4 \"aws:amz:us-east-1:es\" --user \"${awsAccessKey}:${awsSecretKey}\" -H \"x-amz-security-token:${awsSessionToken}\" -H 'Content-Type: application/json' -d "\${INDEX_MAPPING}")
if [[ \$create_index_response == *'"acknowledged":true'* ]]; then
if echo "\$create_index_response" | grep -q '"acknowledged":true'; then
echo "Index created successfully."
echo "Updating alias..."
update_alias_response=\$(curl -s -XPOST "${METRICS_HOST_URL}/_aliases" --aws-sigv4 "aws:amz:us-east-1:es" --user "${awsAccessKey}:${awsSecretKey}" -H "x-amz-security-token:${awsSessionToken}" -H "Content-Type: application/json" -d '{
Expand All @@ -235,7 +235,7 @@ void indexTestFailuresData(testFailuresindexName, testFailuresFile) {
}
]
}')
if [[ \$update_alias_response == *'"acknowledged":true'* ]]; then
if echo "\$update_alias_response" | grep -q '"acknowledged":true'; then
echo "Alias updated successfully."
else
echo "Failed to update alias. Error message: \$update_alias_response"
Expand Down

0 comments on commit fb24c2b

Please sign in to comment.