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

Test docker compose setup builds & runs #2089

Merged
merged 9 commits into from
Dec 6, 2024
Merged
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
19 changes: 15 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Test Docker Image Build
name: Test Docker Image Build & Deploy

on:
push:
branches:
- main
- workflow
- workflowhub
- full-test-suite

Expand All @@ -18,5 +17,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag test-image:$(date +%s)
- name: Create volumes
run: |
docker volume create --name=seek-filestore
docker volume create --name=seek-mysql-db
docker volume create --name=seek-solr-data
docker volume create --name=seek-cache
- name: Build and run the Docker containers
run: docker compose --file docker-compose.yml --file docker-compose.build.yml up --build --detach --wait
continue-on-error: true
- name: Wait and check containers
run: sleep 120 && docker ps -a
continue-on-error: true
- name: Check app status
run: ruby script/check_deployment.rb
5 changes: 5 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
seek:
build: .
seek_workers:
build: .
12 changes: 12 additions & 0 deletions script/check_deployment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
output = `curl --verbose --silent http://localhost:3000/statistics/application_status 2>&1`
if $?.success? && output.include?('FAIRDOM-SEEK is running | search is enabled | 7 delayed jobs running')
exit 0
else
puts "::group::Docker logs"
puts `docker compose --file docker-compose.yml --file docker-compose.build.yml logs`
puts "::endgroup::"
puts "::group::curl output"
puts output
puts "::endgroup::"
exit 1
end
Loading