Skip to content

Commit

Permalink
Merge pull request #25 from Trails-Through-Shadows/development
Browse files Browse the repository at this point in the history
Fixed java version in workflow
  • Loading branch information
Firestone82 authored Jan 26, 2024
2 parents 40b517a + a6f505f commit 145a3e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: actions/setup-java@v2
with:
java-version: 21
distribution: 'adopt'

- name: Build with Maven
run: mvn -B clean package --file pom.xml
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/cz/trailsthroughshadows/api/TtsApiApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public static void main(String[] args) {
// mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);

//.env file load
Dotenv dotenv = Dotenv.configure().directory(".config").load();

Map<String, Object> env = new HashMap<>();
env.put("spring.datasource.url", dotenv.get("DB_HOST") + ":" + dotenv.get("DB_PORT") + "/" + dotenv.get("DB"));
env.put("spring.datasource.driver-class-name", dotenv.get("DB_DRIVER"));
env.put("spring.datasource.username", dotenv.get("DB_USER"));
env.put("spring.datasource.password", dotenv.get("DB_PASSWORD"));
//jdbc:mariadb://49.13.93.112:3306/tts_api

SpringApplication app = new SpringApplication(TtsApiApplication.class);
app.setDefaultProperties(env);
app.run(args);
log.debug("Running with login: " + dotenv.get("DB_USER") + " -> " + dotenv.get("DB_PASSWORD"));


// Dotenv dotenv = Dotenv.configure().directory(".config").load();
//
// Map<String, Object> env = new HashMap<>();
// env.put("spring.datasource.url", dotenv.get("DB_HOST") + ":" + dotenv.get("DB_PORT") + "/" + dotenv.get("DB"));
// env.put("spring.datasource.driver-class-name", dotenv.get("DB_DRIVER"));
// env.put("spring.datasource.username", dotenv.get("DB_USER"));
// env.put("spring.datasource.password", dotenv.get("DB_PASSWORD"));
// //jdbc:mariadb://49.13.93.112:3306/tts_api
//
// SpringApplication app = new SpringApplication(TtsApiApplication.class);
// app.setDefaultProperties(env);
// app.run(args);
// log.debug("Running with login: " + dotenv.get("DB_USER") + " -> " + dotenv.get("DB_PASSWORD"));

SpringApplication.run(TtsApiApplication.class, args);
log.info("Docs running on http://localhost:8080/swagger-ui/index.html");
log.info("API running on http://localhost:8080/");
}
Expand Down
12 changes: 8 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# DataSource Configuration
#spring.datasource.url=<your db url here>
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.username=<your db username>
#spring.datasource.password=<your db password here>
spring.datasource.url=jdbc:mysql://49.13.93.112:3306/tts_api?useSSL=false&serverTimezone=UTC
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=ttsCommie
spring.datasource.password=fXmPjnV7AxKZckgtLBUGJs

# JPA Configuration
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.show-sql=true

# Springdoc Swagger Configuration
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui-custom.html
springdoc.swagger-ui.tagsSorter=alpha

# Logging
logging.level.root=INFO
logging.level.cz.trailsthroughshadows.api=DEBUG
logging.level.cz.trailsthroughshadows.algorithm=INFO
logging.config=classpath:log4j2.xml

#jackson configuration
spring.jackson.serialization.fail-on-empty-beans=false
#spring.jackson.default-property-inclusion=non_null

0 comments on commit 145a3e7

Please sign in to comment.