Skip to content

Commit

Permalink
Update firestore.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
milaGGL committed Oct 18, 2023
1 parent cf74cd8 commit d1e9572
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,19 @@ jobs:
- name: Terraform Apply
run: |
cd Firestore
# Define a temporary file to store the output
output_file=$(mktemp)
# Run terraform apply, redirect both stdout and stderr to the file
# Define a temporary file, redirect both stdout and stderr to it
output_file=$(mktemp)
if ! terraform apply -var-file=../google-service-account.json -auto-approve > "$output_file" 2>&1 ; then
cat "$output_file"
cat "$output_file"
if cat "$output_file" | grep -q "index already exists"; then
echo "==================================================================================="
echo -e "\e[93m\e[1mTerraform apply failed due to index already exists; We can safely ignore this error.\e[0m"
echo "==================================================================================="
fi
exit 1
fi
# Clean up the temporary file
rm -f "$output_file"
rm -f "$output_file"
env:
GOOGLE_APPLICATION_CREDENTIALS: ../google-service-account.json
continue-on-error: true
Expand Down
5 changes: 2 additions & 3 deletions Firestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ If you want to switch back to running integration tests against the emulator:
2. If not already logged in, authenticate with your Google Cloud Platform (GCP) account using
`gcloud auth application-default login`. You can check your logged-in accounts by running
`gcloud auth list`.
3. Create composite indexes by running:
3. Navigate to the `Firestore` directory, create composite indexes by running:
```
cd Firestore
terraform init
terraform apply -var="project_id=<your-project-id>" -auto-approve
```
4. Run integration tests in Xcode as guided in "Running Integration Tests - against production".
4. Run integration tests as guided in "Running Integration Tests - against production".
Note: If the index creation encounters issues, such as concurrent operations, consider running the
index creation process again. Error messages indicating that indexes have already been created can
Expand Down

0 comments on commit d1e9572

Please sign in to comment.