-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/prometheus
- Loading branch information
Showing
8 changed files
with
115 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: unit test on push | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
deploy: | ||
name: unit test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PRIVATE_TOKEN }} | ||
submodules: true | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Build with Gradle | ||
run: | | ||
chmod +x ./gradlew | ||
./gradlew --info test |
Submodule backend-config
updated
from 292c04 to 4c5331
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 30 additions & 4 deletions
34
...icketing/global/config/LettuceConfig.java → ...eting/global/config/LocalRedisConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/com/thirdparty/ticketing/global/config/ProductionRedisConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.thirdparty.ticketing.global.config; | ||
|
||
import org.redisson.Redisson; | ||
import org.redisson.api.RedissonClient; | ||
import org.redisson.config.Config; | ||
import org.redisson.config.SingleServerConfig; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration; | ||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; | ||
|
||
@Profile("prod") | ||
@Configuration | ||
public class ProductionRedisConfig { | ||
|
||
private final int port; | ||
private final String host; | ||
private final String password; | ||
|
||
public ProductionRedisConfig( | ||
@Value("${spring.data.redis.port}") int port, | ||
@Value("${spring.data.redis.host}") String host, | ||
@Value("${spring.data.redis.password}") String password) { | ||
this.port = port; | ||
this.host = host; | ||
this.password = password; | ||
} | ||
|
||
@Bean | ||
public RedissonClient redissonClient() { | ||
Config config = new Config(); | ||
SingleServerConfig serverConfig = config.useSingleServer(); | ||
serverConfig.setAddress("redis://" + host + ":" + port); | ||
serverConfig.setPassword(password); | ||
return Redisson.create(config); | ||
} | ||
|
||
@Bean | ||
public LettuceConnectionFactory lettuceConnectionFactory() { | ||
RedisStandaloneConfiguration config = new RedisStandaloneConfiguration(); | ||
config.setHostName(host); | ||
config.setPort(port); | ||
config.setPassword(password); | ||
return new LettuceConnectionFactory(config); | ||
} | ||
} |
23 changes: 0 additions & 23 deletions
23
src/main/java/com/thirdparty/ticketing/global/config/RedissonConfig.java
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/test/java/com/thirdparty/ticketing/global/config/LettuceConfigTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters