From 8f36fffb184e804f01490c8c5430ff303f02c9de Mon Sep 17 00:00:00 2001 From: "Carlos E. Feria Vila" Date: Sun, 3 Jan 2021 10:38:25 +0100 Subject: [PATCH] Fix e2e test (#25) * Fix e2e test * add gh actions * fix volume * add volumes * remove import * change keycloak image * remove keycloak admin cli action * fix * healthcheck to db * change postgresql version * chnage env * set specific version of postgres * health keycloak * add health to backend --- .github/workflows/ci-actions.yml | 54 +++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index e9ba157..cae9a89 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -47,27 +47,57 @@ jobs: os: [ubuntu-latest] browser: [chrome, firefox] services: - backend: - image: quay.io/projectopenubl/xsender-server:master - ports: - - 8080:8080 keycloak: - image: quay.io/keycloak/keycloak:12.0.1 + image: quay.io/projectopenubl/openubl-keycloak-theme:latest ports: - 8180:8080 env: KEYCLOAK_USER: admin KEYCLOAK_PASSWORD: admin + options: >- + --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + backend-db: + image: postgres:13.1 + ports: + - 5432:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: xsender_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + backend: + image: quay.io/projectopenubl/xsender-server:master + ports: + - 8080:8080 + env: + QUARKUS_DATASOURCE_USERNAME: user + QUARKUS_DATASOURCE_PASSWORD: password + QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://backend-db:5432/xsender_db + QUARKUS_OIDC_AUTH_SERVER_URL: http://keycloak:8080/auth/realms/openubl + QUARKUS_OIDC_CLIENT_ID: xsender + QUARKUS_OIDC_CREDENTIALS_SECRET: secret + options: >- + --health-cmd "curl --fail http://localhost:8080 || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Checkout uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@master - with: - server: http://keycloak:8080/auth - username: admin - password: admin - cmd: create realms -f openubl-realm.json + # - name: Keycloak Admin CLI + # uses: carlosthe19916/keycloak-action@master + # with: + # server: http://keycloak:8080/auth + # username: admin + # password: admin + # cmd: create realms -f openubl-realm.json - run: yarn install - run: yarn build:instrumentation - uses: haya14busa/action-cond@v1