Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Oct 19, 2023
1 parent 78fb3a4 commit c3d2bdc
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Cypress test
runs-on: ubuntu-latest
container:
image: cypress/browsers:node18.12.0-chrome107
#image: cypress/browsers:node18.12.0-chrome107
steps:
- uses: actions/checkout@v4

Expand All @@ -27,17 +27,16 @@ jobs:
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/package-lock.json') }}

- name: Build the backend
run: docker-compose up -f support-services/docker-compose.yml -d
run: sudo docker-compose up -d

- name: Test backend
run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8080/
#- name: Test backend
# run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8080/geonetwork

- name: install dependencies and verify Cypress
env:
# make sure every Cypress install prints minimal information
CI: 1
run: |
cat support-services/.env
npm ci
npx cypress verify
npx cypress info
Expand Down
119 changes: 119 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
volumes:
elasticsearch_data:
geonetwork_data:
postgresql_data:
postgresql_initdb:

services:
database:
image: postgres:15
environment:
POSTGRES_USER: geonetwork
POSTGRES_PASSWORD: geonetwork
POSTGRES_DB: geonetwork
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 10s
timeout: 3s
retries: 3
volumes:
- postgresql_data:/var/lib/postgresql/data
- ./support-services/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.1
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
environment:
discovery.type: single-node
ES_JAVA_OPTS: -Xms512m -Xmx512m
healthcheck:
test:
[
'CMD-SHELL',
'curl -s -f http://localhost:9200/_cat/health >/dev/null || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data

geonetwork:
image: geonetwork:4.2.2
environment:
ES_HOST: elasticsearch
ES_PROTOCOL: http
ES_PORT: 9200
KB_URL: http://kibana:5601
GEONETWORK_DB_TYPE: postgres
GEONETWORK_DB_HOST: database
GEONETWORK_DB_PORT: 5432
GEONETWORK_DB_NAME: geonetwork
GEONETWORK_DB_USERNAME: geonetwork
GEONETWORK_DB_PASSWORD: geonetwork
depends_on:
database:
condition: service_healthy
elasticsearch:
condition: service_healthy
healthcheck:
test:
[
'CMD-SHELL',
'curl -s -f http://localhost:8080/geonetwork/srv/eng/catalog.search >/dev/null || exit 1',
]
interval: 30s
timeout: 10s
retries: 10
volumes:
- geonetwork_data:/var/lib/jetty/webapps/geonetwork/WEB-INF/data/
ports:
- '8080:8080'

init:
image: alpine/curl
# only run init if volumes were cleared
command: sh -c "if [ ! -f /done ]; then run-parts /docker-entrypoint.d --exit-on-error; else echo 'Nothing to do.'; exit 0; fi"
environment:
GEONETWORK_VERSION: 4.2.2
depends_on:
geonetwork:
condition: service_healthy
elasticsearch:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', "sh -c '[ -f /done ]'"]
interval: 5s
timeout: 10s
retries: 10
volumes:
- ./support-services/docker-entrypoint.d:/docker-entrypoint.d
- geonetwork_data:/mnt/geonetwork_data/

ogc-api-records-service:
image: geonetwork/gn-cloud-ogc-api-records-service:4.2.2
environment:
SPRING_PROFILES_ACTIVE: standalone
SPRING_DATASOURCE_URL: jdbc:postgresql://database:5432/geonetwork
SPRING_DATASOURCE_USERNAME: geonetwork
SPRING_DATASOURCE_PASSWORD: geonetwork
GN_BASEURL: http://geonetwork:8080/geonetwork/api
GN_LEGACY_URL: http://geonetwork:8080/geonetwork
GN_INDEX_URL: http://elasticsearch:9200
SERVER_FORWARDHEADERSSTRATEGY: FRAMEWORK
JAVA_OPTS: -Dfile.encoding=UTF-8
depends_on:
geonetwork:
condition: service_healthy
database:
condition: service_healthy
elasticsearch:
condition: service_healthy
ports:
- '8081:8080'

0 comments on commit c3d2bdc

Please sign in to comment.