diff --git a/.vagrant/machines/default/virtualbox/action_provision b/.vagrant/machines/default/virtualbox/action_provision index 8a8b7a899..1b09c2262 100644 --- a/.vagrant/machines/default/virtualbox/action_provision +++ b/.vagrant/machines/default/virtualbox/action_provision @@ -1 +1,2 @@ -1.5:558bbbdc-672d-4236-b18d-0747cd5fbeaf \ No newline at end of file + +1.5:0a8e3252-0dfa-4c2d-93e4-132058372cdb diff --git a/.vagrant/machines/default/virtualbox/action_set_name b/.vagrant/machines/default/virtualbox/action_set_name index 355d3ffd5..59eaf4275 100644 --- a/.vagrant/machines/default/virtualbox/action_set_name +++ b/.vagrant/machines/default/virtualbox/action_set_name @@ -1 +1,2 @@ -1745624815 \ No newline at end of file + +1745717021 diff --git a/.vagrant/machines/default/virtualbox/id b/.vagrant/machines/default/virtualbox/id index 482b8e564..ec93d932f 100644 --- a/.vagrant/machines/default/virtualbox/id +++ b/.vagrant/machines/default/virtualbox/id @@ -1 +1 @@ -558bbbdc-672d-4236-b18d-0747cd5fbeaf \ No newline at end of file +0a8e3252-0dfa-4c2d-93e4-132058372cdb diff --git a/.vagrant/machines/default/virtualbox/index_uuid b/.vagrant/machines/default/virtualbox/index_uuid index e971e5dac..3682df743 100644 --- a/.vagrant/machines/default/virtualbox/index_uuid +++ b/.vagrant/machines/default/virtualbox/index_uuid @@ -1 +1 @@ -400cd81ad83347cf828ce0bd43022163 \ No newline at end of file +400cd81ad83347cf828ce0bd43022163 diff --git a/.vagrant/machines/default/virtualbox/private_key b/.vagrant/machines/default/virtualbox/private_key index 205453936..16eb9c4b7 100644 --- a/.vagrant/machines/default/virtualbox/private_key +++ b/.vagrant/machines/default/virtualbox/private_key @@ -1,8 +1,10 @@ -----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAA -AAtzc2gtZWQyNTUxOQAAACBNkoyert5NF60C2rjOy+AILyPoPkGR2q4Fc/Om -nfAeXQAAAJCq/MI+qvzCPgAAAAtzc2gtZWQyNTUxOQAAACBNkoyert5NF60C -2rjOy+AILyPoPkGR2q4Fc/OmnfAeXQAAAED6zsQ7eTXA+yBDkw3/0A65h6q3 -y/LQartCCPYFBb+vC02SjJ6u3k0XrQLauM7L4AgvI+g+QZHargVz86ad8B5d + +AAtzc2gtZWQyNTUxOQAAACCAZpIqWjfT3tGuR4Xz+e6Cw1CXaZT2qvrJhgTJ +nDff7wAAAJAhtFL2IbRS9gAAAAtzc2gtZWQyNTUxOQAAACCAZpIqWjfT3tGu +R4Xz+e6Cw1CXaZT2qvrJhgTJnDff7wAAAEDSvbiNPJz3gaknOq4NpKVeB0ha +EZfwyaBuUPtR/bGLYoBmkipaN9Pe0a5HhfP57oLDUJdplPaq+smGBMmcN9/v + AAAAB3ZhZ3JhbnQBAgMEBQY= -----END OPENSSH PRIVATE KEY----- diff --git a/.vagrant/machines/default/virtualbox/synced_folders b/.vagrant/machines/default/virtualbox/synced_folders index 37246f821..10edf9f09 100644 --- a/.vagrant/machines/default/virtualbox/synced_folders +++ b/.vagrant/machines/default/virtualbox/synced_folders @@ -1 +1,2 @@ -{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"C:/Users/HP/SCC Practical/spring-petclinic","disabled":false,"__vagrantfile":true}}} \ No newline at end of file +{"virtualbox":{"/home/vagrant/petclinic":{"guestpath":"/home/vagrant/petclinic","hostpath":"C:/Users/Asus User/Desktop/workspace_SCC/spring-petclinic","disabled":false,"__vagrantfile":true}}} + diff --git a/.vagrant/machines/default/virtualbox/vagrant_cwd b/.vagrant/machines/default/virtualbox/vagrant_cwd index fda7ec558..a08db504b 100644 --- a/.vagrant/machines/default/virtualbox/vagrant_cwd +++ b/.vagrant/machines/default/virtualbox/vagrant_cwd @@ -1 +1,5 @@ -C:/Users/HP/SCC Practical/spring-petclinic \ No newline at end of file +<<<<<<< HEAD +C:/Users/HP/SCC Practical/spring-petclinic +======= +C:/Users/Asus User/Desktop/workspace_SCC/spring-petclinic +>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8 diff --git a/Jenkinsfile/Jenkinsfile b/Jenkinsfile/Jenkinsfile new file mode 100644 index 000000000..65494cd6d --- /dev/null +++ b/Jenkinsfile/Jenkinsfile @@ -0,0 +1,56 @@ +pipeline { + agent any // This runs the pipeline on any available agent + + environment { + // Set environment variables if needed + APP_DIR = "/home/vagrant/petclinic" + REPO_URL = "https://github.com/yiting68/spring-petclinic.git" + } + + stages { + stage('Checkout') { + steps { + // Checkout the latest code from the Git repository + git branch: 'main', url: 'https://github.com/yiting68/spring-petclinic.git' + } + } + + stage('Build') { + steps { + // Install dependencies and build the project + sh './gradlew clean build' // assuming you are using Gradle + } + } + + stage('Test') { + steps { + // Run tests (JUnit tests in this case) + sh './gradlew test' + } + } + + stage('Deploy') { + steps { + // Deploy the app, e.g., run the JAR file or deploy to your server + sh 'nohup java -jar build/libs/spring-petclinic-3.4.0.jar > /home/vagrant/petclinic/app.log 2>&1 &' + } + } + } + + post { + always { + // Actions to perform after the pipeline finishes + echo 'Cleaning up' + } + + success { + // Actions if the pipeline is successful + echo 'Build and deploy succeeded!' + } + + failure { + // Actions if the pipeline fails + echo 'Build failed!' + } + } +} diff --git a/Jenkinsfile b/Jenkinsfile~HEAD similarity index 100% rename from Jenkinsfile rename to Jenkinsfile~HEAD diff --git a/Vagrantfile b/Vagrantfile index 330b32b94..7ddc4579b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,8 +11,13 @@ Vagrant.configure("2") do |config| 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" @@ -24,7 +29,11 @@ Vagrant.configure("2") do |config| 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 @@ -43,6 +52,11 @@ Vagrant.configure("2") do |config| # Run the JAR file nohup java -jar build/libs/$JAR_NAME > $APP_DIR/app.log 2>&1 & +<<<<<<< HEAD SHELL -end \ No newline at end of file +end +======= + SHELL +end +>>>>>>> 64ca1a6e8d6262a76717e6ee9e02d13aa15cd1e8 diff --git a/app.log b/app.log new file mode 100644 index 000000000..b8ef11a7a --- /dev/null +++ b/app.log @@ -0,0 +1,49 @@ + + + |\ _,,,--,,_ + /,`.-'`' ._ \-;;,_ + _______ __|,4- ) )_ .;.(__`'-'__ ___ __ _ ___ _______ + | | '---''(_/._)-'(_\_) | | | | | | | | | + | _ | ___|_ _| | | | | |_| | | | __ _ _ + | |_| | |___ | | | | | | | | | | \ \ \ \ + | ___| ___| | | | _| |___| | _ | | _| \ \ \ \ + | | | |___ | | | |_| | | | | | | |_ ) ) ) ) + |___| |_______| |___| |_______|_______|___|_| |__|___|_______| / / / / + ==================================================================/_/_/_/ + +:: Built with Spring Boot :: 3.4.2 + + +2025-04-27T02:54:03.208Z INFO 19277 --- [ main] o.s.s.petclinic.PetClinicApplication : Starting PetClinicApplication v3.4.0 using Java 17.0.7 with PID 19277 (/home/vagrant/petclinic/build/libs/spring-petclinic-3.4.0.jar started by root in /home/vagrant/petclinic) +2025-04-27T02:54:03.276Z INFO 19277 --- [ main] o.s.s.petclinic.PetClinicApplication : No active profile set, falling back to 1 default profile: "default" +2025-04-27T02:54:12.307Z INFO 19277 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2025-04-27T02:54:13.086Z INFO 19277 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 720 ms. Found 2 JPA repository interfaces. +2025-04-27T02:54:17.215Z INFO 19277 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http) +2025-04-27T02:54:17.310Z INFO 19277 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2025-04-27T02:54:17.311Z INFO 19277 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.34] +2025-04-27T02:54:17.522Z INFO 19277 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext +2025-04-27T02:54:17.528Z INFO 19277 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 13471 ms +2025-04-27T02:54:19.226Z INFO 19277 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... +2025-04-27T02:54:20.762Z INFO 19277 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:69a79fe0-12e2-41db-b04b-1a634a94230d user=SA +2025-04-27T02:54:20.772Z INFO 19277 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. +2025-04-27T02:54:21.736Z INFO 19277 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] +2025-04-27T02:54:22.229Z INFO 19277 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.6.5.Final +2025-04-27T02:54:22.529Z INFO 19277 --- [ main] o.h.c.internal.RegionFactoryInitiator : HHH000026: Second-level cache disabled +2025-04-27T02:54:24.816Z INFO 19277 --- [ main] o.s.o.j.p.SpringPersistenceUnitInfo : No LoadTimeWeaver setup: ignoring JPA class transformer +2025-04-27T02:54:25.385Z INFO 19277 --- [ main] org.hibernate.orm.connections.pooling : HHH10001005: Database info: + Database JDBC URL [Connecting through datasource 'HikariDataSource (HikariPool-1)'] + Database driver: undefined/unknown + Database version: 2.3.232 + Autocommit mode: undefined/unknown + Isolation level: undefined/unknown + Minimum pool size: undefined/unknown + Maximum pool size: undefined/unknown +2025-04-27T02:54:33.397Z INFO 19277 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration) +2025-04-27T02:54:33.415Z INFO 19277 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' +2025-04-27T02:54:35.993Z INFO 19277 --- [ main] o.s.d.j.r.query.QueryEnhancerFactory : Hibernate is in classpath; If applicable, HQL parser will be used. +2025-04-27T02:54:42.575Z INFO 19277 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 14 endpoints beneath base path '/actuator' +2025-04-27T02:54:43.642Z INFO 19277 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/' +2025-04-27T02:54:43.697Z INFO 19277 --- [ main] o.s.s.petclinic.PetClinicApplication : Started PetClinicApplication in 47.075 seconds (process running for 55.736) +2025-04-27T02:55:39.754Z INFO 19277 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' +2025-04-27T02:55:39.755Z INFO 19277 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' +2025-04-27T02:55:39.759Z INFO 19277 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 3 ms diff --git a/src/main/resources/messages/messages.properties b/src/main/resources/messages/messages.properties index 1b488e7b5..2fcfc1baa 100644 --- a/src/main/resources/messages/messages.properties +++ b/src/main/resources/messages/messages.properties @@ -7,8 +7,8 @@ duplicateFormSubmission=Duplicate form submission is not allowed typeMismatch.date=invalid date typeMismatch.birthDate=invalid date owner=Owner -firstName=First Name -lastName=Last Name +firstName=enter your First Name +lastName=enter you Last Name address=Address city=City telephone=Telephone diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html index 070e1c770..0f6655791 100644 --- a/src/main/resources/templates/error.html +++ b/src/main/resources/templates/error.html @@ -5,7 +5,7 @@
Exception message
+Exception message