Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]ProfileController추가 #1

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ jobs:
java-version: '17'

- name: create application-secret.yml
run: |
run:
# create application-secret.yml
# mkdir ./src/main/resources
cd ./src/main/resources

# application.yml 파일 생성
# application-secret.yml 파일 생성
touch ./application-secret.yml

# GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기
# echo "${{ secrets.CI_APPLICATION }}" >> ./application-secret.yml
# GitHub-Actions 에서 설정한 값을 application-secret.yml 파일에 쓰기
echo "${{ secrets.CI_APPLICATION }}" >> ./application-secret.yml

# application.yml 파일 확인
cat ./application-secret.yml
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/tiki/server/controller/ProfileController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.tiki.server.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@RequiredArgsConstructor
public class ProfileController {

private final Environment env;
private static final String NULL = "";

@GetMapping("/profile")
public String getProfile() {
return Arrays.stream(env.getActiveProfiles())
.findFirst()
.orElse(NULL);
}
}