Skip to content

Commit

Permalink
Merge pull request #16 from jburel/upgrade
Browse files Browse the repository at this point in the history
Upgrade
  • Loading branch information
jburel authored Jan 30, 2024
2 parents a4a3ef9 + 506f7ad commit be0b284
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Test
run: ./test.sh
- name: Check login
run: ./wait_for_login.sh
- name: Check OMERO.web
run: ./check_web.sh
- name: Check logs
run: docker-compose logs
if: ${{ failure() }}
21 changes: 21 additions & 0 deletions check_web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e
set -u
set -x

# Wait up to 2 mins
i=0
while ! docker compose logs 2>&1 | grep 'Listening at: http://0.0.0.0:4080'; do
i=$(($i+1))
if [ $i -ge 24 ]; then
echo "$(date) - OMERO.web still not listening, giving up"
exit 1
fi
echo "$(date) - waiting for OMERO.web..."
sleep 5
done
echo "OMERO.web listening"

# Check the string "OMERO.web - Login" is present
curl -sL localhost:4080 | grep 'OMERO.web - Login'
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:

database:
image: "postgres:11"
image: "postgres:14"
environment:
POSTGRES_USER: omero
POSTGRES_DB: omero
Expand Down
1 change: 0 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
set -eu

docker compose up -d
./wait_for_login.sh
1 change: 1 addition & 0 deletions wait_for_login.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ OMERO_PASS=omero
OMERO=/opt/omero/server/OMERO.server/bin/omero

# Wait up to 2 mins
echo "Establishing connection with OMERO.server"
docker compose exec -T omeroserver $OMERO login -C -s localhost -u "$OMERO_USER" -q -w "$OMERO_PASS" --retry 120
echo "OMERO.server connection established"

0 comments on commit be0b284

Please sign in to comment.