Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #15

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,33 @@ on:

jobs:
build:
runs-on: ubuntu-latest
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup docker
if: runner.os == 'macos'
run: |
brew install docker
brew install docker-compose
- name: Symlink (compose is now a cli-plugins)
if: runner.os == 'macos'
run: |
mkdir -p ~/.docker/cli-plugins
ln -sfn /usr/local/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
- name: Start docker
if: runner.os == 'macos'
run: colima start
- name: Test
run: ./test.sh
- name: Check login
if: runner.os != 'macos'
run: ./wait_for_login.sh
- name: Check OMERO.web
run: ./check_web.sh
- name: Check logs
run: docker-compose 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"