Skip to content

Commit

Permalink
ci: use tail with grep
Browse files Browse the repository at this point in the history
apply fix also to version 4.3
  • Loading branch information
carlomion committed Apr 16, 2024
1 parent c8176f5 commit 17559cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ jobs:
-p 8004:8080 \
--name nominatim \
nominatim &
./assert-non-empty-json "http://localhost:8004/search.php?q=avenue%20pasteur"
echo "check replication log for Update completed. Count:"
docker exec -i nominatim grep -c 'Update completed.' /var/log/replication.log
docker exec nominatim /bin/bash -c 'tail -f /var/log/replication.log | grep -m 1 -c "Update completed."'
docker stop nominatim
- name: Check UPDATE_MODE=continuous with bind-mount
Expand All @@ -141,7 +142,7 @@ jobs:
./assert-non-empty-json "http://localhost:8004/search.php?q=avenue%20pasteur"
echo "check replication log for Update completed. Count:"
docker exec -i nominatim grep -c 'Update completed.' /var/log/replication.log
docker exec nominatim /bin/bash -c 'tail -f /var/log/replication.log | grep -m 1 -c "Update completed."'
docker stop nominatim
- name: Check import full style
Expand Down Expand Up @@ -202,18 +203,21 @@ jobs:
- name: Check for clean shutdown
working-directory: .github/workflows
run: |-
docker run --detach --rm \
docker run -i \
-e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
-e USER_AGENT=${{matrix.nominatim.user_agent}} \
-p 8009:8080 \
--name nominatim \
nominatim
nominatim &
./assert-non-empty-json "http://localhost:8009/search.php?q=avenue%20pasteur"
# Shutdown the container
docker stop -t 60 nominatim
# Verify that the exit code is zero
CONTAINER_EXIT_CODE=$(docker inspect nominatim --format='{{.State.ExitCode}}')
# Cleanup container
docker rm nominatim
echo "container exited with exit-code $CONTAINER_EXIT_CODE"
test "$CONTAINER_EXIT_CODE" -eq 0
- name: Check when using FREEZE
Expand Down
8 changes: 7 additions & 1 deletion 4.3/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ replicationpid=0
stopServices() {
service apache2 stop
service postgresql stop
kill $replicationpid
# Check if the replication process is active
if [ $replicationpid -ne 0 ]; then
echo "Shutting down replication process"
kill $replicationpid
fi
kill $tailpid
# Force exit code 0 to signal a succesfull shutdown to Docker
exit 0
}
trap stopServices SIGTERM TERM INT

Expand Down

0 comments on commit 17559cf

Please sign in to comment.