Skip to content

Commit

Permalink
👷 Ci : ci/cd pipeline 구축
Browse files Browse the repository at this point in the history
  • Loading branch information
CYY1007 committed Dec 1, 2023
1 parent cd5ef17 commit ed22a41
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest # (3).OS환경
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event.pull_request && github.event.pull_request.merged == true)
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)


steps:
Expand Down
38 changes: 38 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
server:
port: 8080

eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka

# default profile
spring:
application:
name: apigateway-service
profiles:
active: dev
---
spring:
config:
activate:
on-profile: dev
cloud:
gateway:
routes: # 라우팅 설정
- id: first-service # 구분하기 위한 id값으로 임의로 작성해도 무관
predicates: # 조건
- Path=/dev/** # first-service/ 으로 요청이 들어오면
uri: lb://dev # 유레카 서버에서 MY-FIRST-SERVICE를 찾아서 그곳으로 요청을 보낸다.
filters:
# url 재정의
# ?<변수명>은 뒤에 나오는 정규식을 변수처럼 사용할 수 있도록 한다. ()는 하나의 묶음 처리 -> segment는 (.*)를 의미
# 콤마(,)를 기준으로 왼쪽 url을 오른쪽 url로 재정의한다.
# 콤마 기준 오른쪽 부분은 ${변수명}으로 url 가져오고 앞에 / 붙여준거라고 보면 된다.
- RewritePath=/dev/(?<segment>.*), /$\{segment}
- id: second-service
predicates:
- Path=/release/**
uri: lb://release
filters:
- RewritePath=/release/(?<segment>.*), /$\{segment}

0 comments on commit ed22a41

Please sign in to comment.