Skip to content

Commit

Permalink
Merge pull request #46 from nilshartmann/spring_boot_3_2
Browse files Browse the repository at this point in the history
Spring Boot 3.2 Upgrade and more...
  • Loading branch information
nilshartmann authored Nov 23, 2023
2 parents 944de84 + dd0ce59 commit 8e08188
Show file tree
Hide file tree
Showing 239 changed files with 14,001 additions and 231,097 deletions.
174 changes: 174 additions & 0 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
on:
- push

jobs:
petclinic-graphiql:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./petclinic-graphiql

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Install dependencies
run: pnpm install
- name: Build application
run: pnpm build
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: graphiql-dist
path: ./petclinic-graphiql/dist/**
retention-days: 1

backend:
runs-on: ubuntu-latest
needs: petclinic-graphiql
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Java 21
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: Clear embedded graphiql
run: rm -rf backend/src/main/resources/ui/graphiql
- name: Download graphiql
uses: actions/download-artifact@v3
with:
name: graphiql-dist
path: backend/src/main/resources/ui/graphiql
- name: show graphiql artifact
run: ls -lR backend/src/main/resources/ui/
- name: Build with maven
run: ./mvnw -pl backend spring-boot:build-image -Dspring-boot.build-image.imageName=spring-petclinic/petclinic-graphql-backend:0.0.1
- name: Export docker image
run: docker save spring-petclinic/petclinic-graphql-backend:0.0.1|gzip>petclinic-graphql-backend.tar.gz
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: petclinic-backend-docker
path: petclinic-graphql-backend.tar.gz
retention-days: 1

frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Install dependencies
run: pnpm install
- name: Code checks
run: pnpm run check
- name: Build application
run: pnpm build
- name: Build frontend docker image
run: docker build . --tag spring-petclinic/petclinic-graphql-frontend:0.0.1
- name: Export frontend docker image
run: docker save spring-petclinic/petclinic-graphql-frontend:0.0.1|gzip>../petclinic-graphql-frontend.tar.gz
- name: LS
run: ls -lR ..
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: petclinic-frontend-docker
path: petclinic-graphql-frontend.tar.gz
retention-days: 1

end-to-end-test:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: [petclinic-graphiql,backend,frontend]
steps:
- name: setup playwright
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Download backend artifacts
uses: actions/download-artifact@v3
with:
name: petclinic-backend-docker
path: petclinic-backend-docker
- name: Download frontend docker image
uses: actions/download-artifact@v3
with:
name: petclinic-frontend-docker
path: petclinic-frontend-docker
- name: LS
run: ls -lR
- name: Import backend Docker image
run: gunzip -c petclinic-backend-docker/petclinic-graphql-backend.tar.gz|docker load
- name: Import frontend Docker image
run: gunzip -c petclinic-frontend-docker/petclinic-graphql-frontend.tar.gz|docker load
- name: run docker compose
run: docker-compose -f docker-compose-petclinic.yml up -d
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Install dependencies
working-directory: ./e2e-tests
run: pnpm install
- name: Install Playwright Browsers
working-directory: ./e2e-tests
run: pnpm exec playwright install --with-deps
- name: wait for backend on port 3090
uses: iFaxity/[email protected]
with:
resource: http-get://localhost:3090
- name: wait for frontend on port 3091
uses: iFaxity/[email protected]
with:
resource: http-get://localhost:3091
- name: Run Playwright tests
working-directory: ./e2e-tests
run: pnpm test:docker-compose
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: PlayWright Test # Name of the check run which will be created
path: e2e-tests/test-results.xml # Path to test results
reporter: java-junit # Format of test results
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./e2e-tests/playwright-report/
retention-days: 2
26 changes: 0 additions & 26 deletions .github/workflows/maven-build.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target/*
.idea
*.iml
/target
*/target/

generated/

Expand Down
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM gitpod/workspace-full
USER gitpod

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && \
sdk install java 17.0.3-ms && \
sdk default java 17.0.3-ms"
sdk install java 21-tem && \
sdk default java 21-tem"

# Install custom tools, runtime, etc. using apt-get
# For example, the command below would install "bastet" - a command line tetris clone:
Expand Down
30 changes: 7 additions & 23 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,25 @@ tasks:
init: |
gp sync-await build
command: |
export PETCLINIC_ALLOWED_ORIGINS=`gp url 9977`,`gp url 3000`
export SPRING_DOCKER_COMPOSE_FILE=/workspace/spring-petclinic-graphql/docker-compose.yml
./mvnw spring-boot:run -pl backend
- name: "Frontend"
init: |
cd frontend
npm install
npm run build
cp build/index.html build/index-orig.html
corepack enable
pnpm install
pnpm build
command: |
gp await-port 9977
export BACKEND_HOST=`gp url 9977`
gp ports await 9977
cd $GITPOD_REPO_ROOT/frontend
node patch-index-html.js
./node_modules/.bin/serve -s build
pnpm dev
ports:
- port: 9977
onOpen: open-browser
visibility: public
- port: 3000
- port: 3080
onOpen: open-browser
visibility: public
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true
vscode:
extensions:
- redhat.java
Expand Down
12 changes: 12 additions & 0 deletions .run/Frontend.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Frontend" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/frontend/package.json" />
<command value="run" />
<scripts>
<script value="dev" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
16 changes: 0 additions & 16 deletions backend/.graphqlconfig

This file was deleted.

Loading

0 comments on commit 8e08188

Please sign in to comment.