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

Feature/790 tmp disable e2e on deploy demo #965

Merged
Merged
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
131 changes: 66 additions & 65 deletions .github/workflows/demo-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,74 +92,75 @@ jobs:
- name: print imagetags
run: echo ${{ needs.update-version.outputs.okr-docker-image}}

e2e-docker:
runs-on: ubuntu-22.04
needs: [build-docker-image,update-version]
steps:
- uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: okr-image
path: /tmp

- name: Load image
run: docker load --input /tmp/okr-docker-image.tar

- name: show images
run: docker image ls -a

- name: Run docker image
run: |
docker run --network=host \
-p 8080:8080 \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER-URI=http://localhost:8544/realms/pitc \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=http://localhost:8544/realms/pitc/protocol/openid-connect/certs \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_OPAQUETOKEN_CLIENT-ID=pitc_okr_staging \
-e SPRING_PROFILES_ACTIVE-ID=integration-test \
-e SPRING_DATASOURCE_URL="jdbc:h2:mem:db;DB_CLOSE_DELAY=-1" \
-e SPRING_DATASOURCE_USERNAME=user \
-e SPRING_DATASOURCE_PASSWORD=sa \
-e SPRING_FLYWAY_LOCATIONS="classpath:db/h2-db/database-h2-schema,classpath:db/h2-db/data-test-h2" \
${{ needs.update-version.outputs.okr-docker-image}} &

- name: run keycloak docker
run: |
docker run \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=keycloak \
-v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \
-p 8544:8080 \
quay.io/keycloak/keycloak:23.0.1 \
start-dev --import-realm &

- uses: abhi1693/[email protected]
with:
browser: chrome
version: latest

- name: Cypress run e2e tests
uses: cypress-io/github-action@v6
with:
build: npm i -D cypress
install: false
wait-on: 'http://pitc.okr.localhost:8080/config, http://pitc.okr.localhost:4200, http://localhost:8544'
wait-on-timeout: 120
browser: chrome
headed: true
working-directory: frontend
config: baseUrl=http://pitc.okr.localhost:8080

- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-screenshots
path: frontend/cypress/screenshots
# e2e-docker:
# runs-on: ubuntu-22.04
# needs: [build-docker-image,update-version]
# steps:
# - uses: actions/checkout@v4
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: okr-image
# path: /tmp
#
# - name: Load image
# run: docker load --input /tmp/okr-docker-image.tar
#
# - name: show images
# run: docker image ls -a
#
# - name: Run docker image
# run: |
# docker run --network=host \
# -p 8080:8080 \
# -e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER-URI=http://localhost:8544/realms/pitc \
# -e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=http://localhost:8544/realms/pitc/protocol/openid-connect/certs \
# -e SPRING_SECURITY_OAUTH2_RESOURCESERVER_OPAQUETOKEN_CLIENT-ID=pitc_okr_staging \
# -e SPRING_PROFILES_ACTIVE-ID=integration-test \
# -e SPRING_DATASOURCE_URL="jdbc:h2:mem:db;DB_CLOSE_DELAY=-1" \
# -e SPRING_DATASOURCE_USERNAME=user \
# -e SPRING_DATASOURCE_PASSWORD=sa \
# -e SPRING_FLYWAY_LOCATIONS="classpath:db/h2-db/database-h2-schema,classpath:db/h2-db/data-test-h2" \
# ${{ needs.update-version.outputs.okr-docker-image}} &
#
# - name: run keycloak docker
# run: |
# docker run \
# -e KEYCLOAK_ADMIN=admin \
# -e KEYCLOAK_ADMIN_PASSWORD=keycloak \
# -v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \
# -p 8544:8080 \
# quay.io/keycloak/keycloak:23.0.1 \
# start-dev --import-realm &
#
# - uses: abhi1693/[email protected]
# with:
# browser: chrome
# version: latest
#
# - name: Cypress run e2e tests
# uses: cypress-io/github-action@v6
# with:
# build: npm i -D cypress
# install: false
# wait-on: 'http://pitc.okr.localhost:8080/config, http://pitc.okr.localhost:4200, http://localhost:8544'
# wait-on-timeout: 120
# browser: chrome
# headed: true
# working-directory: frontend
# config: baseUrl=http://pitc.okr.localhost:8080
#
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: cypress-screenshots
# path: frontend/cypress/screenshots

upload-to-quay:
runs-on: ubuntu-latest
needs: [e2e-docker, update-version]
# needs: [e2e-docker, update-version]
needs: [build-docker-image, update-version]
steps:
- uses: actions/checkout@v4

Expand Down
Loading