Skip to content

Commit

Permalink
Merge pull request #184 from com-pas/chore/update-keycloak-image-expe…
Browse files Browse the repository at this point in the history
…rimental-no-auth-path

chore: Update keycloak image
  • Loading branch information
clepski authored Sep 25, 2024
2 parents 2dd2cbe + 54b368c commit adce5d1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/run-integration-tests-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Start containers
run: docker-compose -f "compas/docker-compose-postgresql.yml" up -d --build
run: docker compose -f "compas/docker-compose-postgresql.yml" up -d --build
env:
COMPAS_HOSTNAME: compas_reverse-proxy_1
COMPAS_HOSTNAME: compas-reverse-proxy-1
CONFIGURATION_LOCATION: /nginx.conf

- name: Wait until containers started
Expand All @@ -45,11 +45,11 @@ jobs:
- name: Execute integration tests (firefox)
# Using the Docker Image from ppodgorsek (https://github.com/ppodgorsek/docker-robot-framework)
# to run the Robot Framework Test Scripts.
# To connect with the Docker Compose and use http://compas_reverse-proxy_1/ as URL we are
# To connect with the Docker Compose and use http://compas-reverse-proxy-1/ as URL we are
# connecting to the same network "compas_default" that's started bij Docker Compose.
run: |
docker run --rm -e BROWSER=firefox \
-e ROBOT_OPTIONS="-v url:http://compas_reverse-proxy_1/" \
-e ROBOT_OPTIONS="-v url:http://compas-reverse-proxy-1/" \
-v $(pwd)/target/firefox:/opt/robotframework/reports:Z \
-v $(pwd)/integration-testing:/opt/robotframework/tests:Z \
--user $(id -u):$(id -g) \
Expand All @@ -61,11 +61,11 @@ jobs:
- name: Execute integration tests (chromium)
# Using the Docker Image from ppodgorsek (https://github.com/ppodgorsek/docker-robot-framework)
# to run the Robot Framework Test Scripts.
# To connect with the Docker Compose and use http://compas_reverse-proxy_1/ as URL we are
# To connect with the Docker Compose and use http://compas-reverse-proxy-1/ as URL we are
# connecting to the same network "compas_default" that's started bij Docker Compose.
run: |
docker run --rm -e BROWSER=chromium \
-e ROBOT_OPTIONS="-v url:http://compas_reverse-proxy_1/" \
-e ROBOT_OPTIONS="-v url:http://compas-reverse-proxy-1/" \
-v $(pwd)/target/firefox:/opt/robotframework/reports:Z \
-v $(pwd)/integration-testing:/opt/robotframework/tests:Z \
--user $(id -u):$(id -g) \
Expand All @@ -84,4 +84,4 @@ jobs:
- name: Stop containers
if: always()
run: docker-compose -f "compas/docker-compose-postgresql.yml" down -v
run: docker compose -f "compas/docker-compose-postgresql.yml" down -v
8 changes: 4 additions & 4 deletions compas/docker-compose-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ services:
ports:
- "8089:8080"
environment:
- KEYCLOAK_FRONTEND_URL=http://${COMPAS_HOSTNAME}/auth/
- KEYCLOAK_HOSTNAME=${COMPAS_HOSTNAME}
- KEYCLOAK_HTTP_PORT=80
- PROXY_ADDRESS_FORWARDING=true
- KC_HOSTNAME=http://${COMPAS_HOSTNAME}/auth/
- KC_HTTP_RELATIVE_PATH=auth
- KC_HTTP_ENABLED=true
- KC_PROXY_HEADERS=xforwarded
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/auth/"]
interval: 30s
Expand Down
18 changes: 7 additions & 11 deletions compas/keycloak/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM jboss/keycloak:latest
FROM quay.io/keycloak/keycloak:latest

ARG COMPAS_HOSTNAME

# Copy the demo realm configuration to /tmp/ inside the container, so it can be used afterwards
COPY --chown=jboss:jboss keycloak_compas_realm.json /tmp/keycloak_compas_realm.json
RUN sed -i "s/##COMPAS_HOSTNAME##/${COMPAS_HOSTNAME}/g" /tmp/keycloak_compas_realm.json
# Copy the demo realm configuration to /opt/keycloak/data/import inside the container, this is the default import path
COPY --chown=keycloak:keycloak keycloak_compas_realm.json /opt/keycloak/data/import/keycloak_compas_realm.json
RUN sed -i "s/##COMPAS_HOSTNAME##/${COMPAS_HOSTNAME}/g" /opt/keycloak/data/import/keycloak_compas_realm.json

# Creating an Admin account
ENV KEYCLOAK_USER admin
ENV KEYCLOAK_PASSWORD admin
ENV KC_DB_USERNAME admin
ENV KC_DB_PASSWORD admin

# Choosing h2 database
ENV DB_VENDOR h2

# Import the configuration we just copied
ENV KEYCLOAK_IMPORT /tmp/keycloak_compas_realm.json
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm"]
4 changes: 2 additions & 2 deletions integration-testing/TestSuite003-cim-mapping.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ TestCase003-01
Open Project from CIM ${sclname} ${scltype}

Select Tab Substation
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
Get Text ${substation-editor-selector} section > h1:has-text("af9a4ae3-ba2e-4c34-8e47-5af894ee20f4 - Sub1")

TestCase003-02
[Documentation] Trying to create a project from Invalid CIM Filename
skip
[Documentation] Trying to create a project from Invalid CIM Filename
Set Test Variable ${sclname} MiniGridTestConfiguration_Invalid_XML

${promise}= Promise To Upload File ${CURDIR}/test-files/${sclname}.xml
Expand Down

0 comments on commit adce5d1

Please sign in to comment.