From ba97add4a21f6ba7580b537e43b608101a57970f Mon Sep 17 00:00:00 2001 From: Rostislav Raykov Date: Wed, 9 Oct 2024 00:14:08 +0300 Subject: [PATCH] moved the location of the files in the docker --- .gitignore | 3 +++ Jenkinsfile | 2 +- src/main/resources/application.properties | 7 ++++--- .../org/rostislav/quickdrop/QuickdropApplicationTests.java | 2 ++ src/test/resources/application-test-.properties | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/test/resources/application-test-.properties diff --git a/.gitignore b/.gitignore index 549e00a..65fc999 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ build/ ### VS Code ### .vscode/ +/db/ +/log/ +/files/ diff --git a/Jenkinsfile b/Jenkinsfile index f46ec58..f73d8d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,7 +49,7 @@ pipeline { -p 8083:8080 \ -v /var/lib/quickdrop/db:/app/db \ -v /var/log/quickdrop:/app/log \ - -v /srv/quickdrop/files:/files \ + -v /srv/quickdrop/files:/app/files \ ${DOCKER_IMAGE} """ } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5cf2b11..03968c0 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,8 @@ +spring.profiles.active=default spring.application.name=quickdrop spring.datasource.driver-class-name=org.sqlite.JDBC spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect -spring.datasource.url=jdbc:sqlite:/db/quickdrop.db +spring.datasource.url=jdbc:sqlite:db/quickdrop.db spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update spring.thymeleaf.prefix=classpath:/templates/ @@ -10,9 +11,9 @@ spring.thymeleaf.cache=false spring.servlet.multipart.max-file-size=1024MB spring.servlet.multipart.max-request-size=1024MB server.tomcat.connection-timeout=60000 -file.save.path=/files +file.save.path=files file.max.age=30 -logging.file.path=/log +logging.file.path=log logging.file.name=quickdrop.log file.deletion.cron=0 0 2 * * * #logging.level.org.springframework=DEBUG diff --git a/src/test/java/org/rostislav/quickdrop/QuickdropApplicationTests.java b/src/test/java/org/rostislav/quickdrop/QuickdropApplicationTests.java index cbfda1c..ec907fc 100644 --- a/src/test/java/org/rostislav/quickdrop/QuickdropApplicationTests.java +++ b/src/test/java/org/rostislav/quickdrop/QuickdropApplicationTests.java @@ -2,8 +2,10 @@ package org.rostislav.quickdrop; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; @SpringBootTest +@ActiveProfiles("test") class QuickdropApplicationTests { @Test diff --git a/src/test/resources/application-test-.properties b/src/test/resources/application-test-.properties new file mode 100644 index 0000000..2735997 --- /dev/null +++ b/src/test/resources/application-test-.properties @@ -0,0 +1,2 @@ +logging.file.path= +spring.datasource.url=jdbc:sqlite:quickdrop.db \ No newline at end of file