mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 22:35:50 +00:00
Merge branch 'yeeqi/feature/editSize' into main
This commit is contained in:
commit
0a2f2e6748
19 changed files with 155 additions and 11 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
32
.github/workflows/gradle-build.yml
vendored
32
.github/workflows/gradle-build.yml
vendored
|
@ -5,17 +5,16 @@ name: Java CI with Gradle
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [ '17' ]
|
java: ["17"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -23,9 +22,32 @@ jobs:
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: ${{matrix.java}}
|
java-version: ${{matrix.java}}
|
||||||
distribution: 'adopt'
|
distribution: "adopt"
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
|
||||||
|
# Below are added codes
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: "17"
|
||||||
|
distribution: "adopt"
|
||||||
|
- name: Run tests
|
||||||
|
run: ./gradlew test
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: self-hosted # Use your own machine for deploying
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Deploy to Vagrant VM
|
||||||
|
run: |
|
||||||
|
vagrant up --provision
|
||||||
|
|
2
.vagrant/machines/default/virtualbox/action_provision
Normal file
2
.vagrant/machines/default/virtualbox/action_provision
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
1.5:0a8e3252-0dfa-4c2d-93e4-132058372cdb
|
2
.vagrant/machines/default/virtualbox/action_set_name
Normal file
2
.vagrant/machines/default/virtualbox/action_set_name
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
1745717021
|
1
.vagrant/machines/default/virtualbox/box_meta
Normal file
1
.vagrant/machines/default/virtualbox/box_meta
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"name":"ubuntu/bionic64","version":"20230607.0.5","provider":"virtualbox","directory":"boxes/ubuntu-VAGRANTSLASH-bionic64/20230607.0.5/virtualbox"}
|
1
.vagrant/machines/default/virtualbox/creator_uid
Normal file
1
.vagrant/machines/default/virtualbox/creator_uid
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0
|
1
.vagrant/machines/default/virtualbox/id
Normal file
1
.vagrant/machines/default/virtualbox/id
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0a8e3252-0dfa-4c2d-93e4-132058372cdb
|
1
.vagrant/machines/default/virtualbox/index_uuid
Normal file
1
.vagrant/machines/default/virtualbox/index_uuid
Normal file
|
@ -0,0 +1 @@
|
||||||
|
400cd81ad83347cf828ce0bd43022163
|
10
.vagrant/machines/default/virtualbox/private_key
Normal file
10
.vagrant/machines/default/virtualbox/private_key
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAA
|
||||||
|
|
||||||
|
AAtzc2gtZWQyNTUxOQAAACCAZpIqWjfT3tGuR4Xz+e6Cw1CXaZT2qvrJhgTJ
|
||||||
|
nDff7wAAAJAhtFL2IbRS9gAAAAtzc2gtZWQyNTUxOQAAACCAZpIqWjfT3tGu
|
||||||
|
R4Xz+e6Cw1CXaZT2qvrJhgTJnDff7wAAAEDSvbiNPJz3gaknOq4NpKVeB0ha
|
||||||
|
EZfwyaBuUPtR/bGLYoBmkipaN9Pe0a5HhfP57oLDUJdplPaq+smGBMmcN9/v
|
||||||
|
|
||||||
|
AAAAB3ZhZ3JhbnQBAgMEBQY=
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
2
.vagrant/machines/default/virtualbox/synced_folders
Normal file
2
.vagrant/machines/default/virtualbox/synced_folders
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{"virtualbox":{"/home/vagrant/petclinic":{"guestpath":"/home/vagrant/petclinic","hostpath":"C:/Users/Asus User/Desktop/workspace_SCC/spring-petclinic","disabled":false,"__vagrantfile":true}}}
|
||||||
|
|
5
.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
5
.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<<<<<<< HEAD
|
||||||
|
C:/Users/HP/SCC Practical/spring-petclinic
|
||||||
|
=======
|
||||||
|
C:/Users/Asus User/Desktop/workspace_SCC/spring-petclinic
|
||||||
|
>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8
|
12
.vagrant/rgloader/loader.rb
Normal file
12
.vagrant/rgloader/loader.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Copyright (c) HashiCorp, Inc.
|
||||||
|
# SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
|
# This file loads the proper rgloader/loader.rb file that comes packaged
|
||||||
|
# with Vagrant so that encoded files can properly run with Vagrant.
|
||||||
|
|
||||||
|
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
|
||||||
|
require File.expand_path(
|
||||||
|
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
|
||||||
|
else
|
||||||
|
raise "Encoded files can't be read outside of the Vagrant installer."
|
||||||
|
end
|
62
Vagrantfile
vendored
Normal file
62
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
# Use the ubuntu/bionic64 box
|
||||||
|
config.vm.box = "ubuntu/bionic64"
|
||||||
|
config.vm.boot_timeout = 600000
|
||||||
|
|
||||||
|
# Configuring VirtualBox provider settings
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.name = "MyVB"
|
||||||
|
vb.cpus = 2
|
||||||
|
vb.memory = "2048"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Configuring VirtualBox network settings
|
||||||
|
<<<<<<< HEAD
|
||||||
|
config.vm.network "forwarded_port", guest: 8080, host: 8086
|
||||||
|
~
|
||||||
|
=======
|
||||||
|
config.vm.network "forwarded_port", guest: 8080, host: 8087
|
||||||
|
|
||||||
|
>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8
|
||||||
|
# Configuring VirtualBox folder settings
|
||||||
|
config.vm.synced_folder ".", "/home/vagrant/petclinic"
|
||||||
|
|
||||||
|
# Provisioning with a shell script to run the JAR file
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
apt update
|
||||||
|
apt install -y openjdk-17-jdk git unzip
|
||||||
|
|
||||||
|
APP_DIR="/home/vagrant/petclinic"
|
||||||
|
REPO_URL="https://github.com/yiting68/spring-petclinic.git"
|
||||||
|
JAR_NAME="spring-petclinic-3.4.0.jar"
|
||||||
|
<<<<<<< HEAD
|
||||||
|
SERVICE_NAME="petclinic"~~
|
||||||
|
=======
|
||||||
|
SERVICE_NAME="petclinic"
|
||||||
|
>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8
|
||||||
|
|
||||||
|
# Clone Spring PetClinic project if does not exist
|
||||||
|
if [ ! -d "$APP_DIR/.git" ]; then
|
||||||
|
git clone "$REPO_URL" "$APP_DIR"
|
||||||
|
# Pull latest changes if project already exists
|
||||||
|
else
|
||||||
|
cd "$APP_DIR"
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Navigate to the project directory
|
||||||
|
cd "$APP_DIR"
|
||||||
|
|
||||||
|
# Build the JAR file
|
||||||
|
./gradlew build
|
||||||
|
|
||||||
|
# Run the JAR file
|
||||||
|
nohup java -jar build/libs/$JAR_NAME > $APP_DIR/app.log 2>&1 &
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
=======
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8
|
23
build.gradle
23
build.gradle
|
@ -6,6 +6,7 @@ plugins {
|
||||||
id 'org.cyclonedx.bom' version '1.10.0'
|
id 'org.cyclonedx.bom' version '1.10.0'
|
||||||
id 'io.spring.javaformat' version '0.0.43'
|
id 'io.spring.javaformat' version '0.0.43'
|
||||||
id "io.spring.nohttp" version "0.0.11"
|
id "io.spring.nohttp" version "0.0.11"
|
||||||
|
id 'jacoco'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
@ -25,6 +26,18 @@ repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
jacoco {
|
||||||
|
toolVersion = "0.8.11" // The Latest version
|
||||||
|
}
|
||||||
|
|
||||||
|
jacocoTestReport {
|
||||||
|
dependsOn test // Ensures tests run before generating reports
|
||||||
|
reports {
|
||||||
|
xml.required = true // Required for CI tools (e.g., SonarQube)
|
||||||
|
html.required = true // Human-readable HTML report
|
||||||
|
}
|
||||||
|
}
|
||||||
ext.checkstyleVersion = "10.20.1"
|
ext.checkstyleVersion = "10.20.1"
|
||||||
ext.springJavaformatCheckstyleVersion = "0.0.43"
|
ext.springJavaformatCheckstyleVersion = "0.0.43"
|
||||||
ext.webjarsLocatorLiteVersion = "1.0.1"
|
ext.webjarsLocatorLiteVersion = "1.0.1"
|
||||||
|
@ -88,3 +101,13 @@ checkFormatAotTest.enabled = false
|
||||||
|
|
||||||
formatAot.enabled = false
|
formatAot.enabled = false
|
||||||
formatAotTest.enabled = false
|
formatAotTest.enabled = false
|
||||||
|
|
||||||
|
// Custom Build task
|
||||||
|
task printBuildInfo {
|
||||||
|
doLast {
|
||||||
|
println "Hi,we edit here!!"
|
||||||
|
println "Project: ${project.name}"
|
||||||
|
println "Version: ${version}"
|
||||||
|
println "Java Version: ${java.sourceCompatibility}" // Uses sourceCompatibility instead of toolchain
|
||||||
|
}
|
||||||
|
}
|
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
welcome=Welcome
|
welcome=Welcome to the Pet Clinic
|
||||||
required=is required
|
required=is required
|
||||||
notFound=has not been found
|
notFound=has not been found
|
||||||
duplicate=is already in use
|
duplicate=is already in use
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<body>
|
<body>
|
||||||
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/>
|
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/>
|
||||||
<h2 th:text="#{somethingHappened}">Something happened...</h2>
|
<h2 th:text="#{somethingHappened}">Something happened...</h2>
|
||||||
<p th:text="${message}">Exception message</p>
|
<p th:text="${message}" style="color:red;">Exception message</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
.navbar a.navbar-brand span {
|
.navbar a.navbar-brand span {
|
||||||
display: block;
|
display: block;
|
||||||
width: 229px;
|
width: 231px;
|
||||||
height: 46px;
|
height: 44px;
|
||||||
background: url("../images/spring-logo-dataflow.png") -1px -48px no-repeat;
|
background: url("../images/spring-logo-dataflow.png") -1px -48px no-repeat;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
-moz-transition: opacity 0.12s ease-in-out;
|
-moz-transition: opacity 0.12s ease-in-out;
|
||||||
|
|
|
@ -105,7 +105,7 @@ h1 {
|
||||||
|
|
||||||
.index-page--subtitle {
|
.index-page--subtitle {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 24px;
|
line-height: 23px;
|
||||||
margin: 0 0 30px;
|
margin: 0 0 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ h1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#job-params-modal .modal-dialog {
|
#job-params-modal .modal-dialog {
|
||||||
width: 90%;
|
width: 92%;
|
||||||
margin-left:auto;
|
margin-left:auto;
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue