Skip to content

Commit

Permalink
Merge pull request #1 from Team-Tiki/CITEST1
Browse files Browse the repository at this point in the history
[FEAT]ProfileController추가
  • Loading branch information
paragon0107 authored Jun 24, 2024
2 parents 8d9b5c8 + dba91e1 commit 6aa4508
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
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);
}
}

0 comments on commit 6aa4508

Please sign in to comment.