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

[RELEASE] 릴리즈 v1.2.5 #273

Closed
wants to merge 7 commits into from
Closed
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
63 changes: 63 additions & 0 deletions .github/workflows/build-dockerhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 이미지 빌드 & 푸쉬
on:
workflow_call:
outputs:
image-url:
value: ${{ jobs.build.outputs.image-url }}
inputs:
image-name:
required: true
type: string
image-tag:
required: true
type: string
spring-profile:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:
build:
runs-on: [ ubuntu-latest ]
name: 이미지 빌드하기

outputs:
image-url: ${{ steps.build-image.outputs.image-url }}

permissions:
id-token: write
contents: read

steps:
- name: GitHub 에서 레포 받아오기
uses: actions/checkout@v3

- name: JDK17 준비하기
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Docker Hub 로그인하기
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Gradle 준비하기
uses: gradle/actions/setup-gradle@v3

- name: 이미지 빌드하고 푸쉬하기
id: build-image
run: |
chmod +x jib.sh &&
chmod +x ./gradlew &&
/bin/bash jib.sh \
${{ inputs.image-name }} \
${{ inputs.image-tag }} \
${{ inputs.spring-profile }} &&
echo "image-url=${{ inputs.image-name }}:${{ inputs.image-tag }}" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/build-ecr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
distribution: 'temurin'

- name: Gradle 준비하기
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: AWS 인증정보 준비하기
uses: aws-actions/configure-aws-credentials@v2
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/deploy-argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: ArgoCD로 배포하기
on:
workflow_call:
inputs:
argocd-repo-name:
required: true
type: string
overlay-name:
required: true
type: string
service-name:
required: true
type: string
default-image-name:
required: true
type: string
image-name:
required: true
type: string
environment:
required: true
type: string
image-tag:
required: true
type: string
secrets:
PAT_TOKEN:
required: true

jobs:
build:
runs-on: [ ubuntu-latest ]
name: ArgoCD로 배포하기

environment: ${{ inputs.environment }}

steps:
- name: GitHub 에서 레포 받아오기
uses: actions/checkout@v3
with:
repository: ${{ inputs.argocd-repo-name }}
token: ${{ secrets.PAT_TOKEN }}

- name: Kustomize 설정하기
uses: imranismail/setup-kustomize@v2

- name: 이미지 태그 변경 후 배포하기
run: |
cd ${{ inputs.service-name }}/overlays/${{ inputs.overlay-name }}
kustomize edit set image ${{ inputs.default-image-name }}=${{ inputs.image-name }}:${{ inputs.image-tag }}
cat kustomization.yaml
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "release(${{ inputs.service-name }}): 자동배포 ${{ inputs.image-name }}:${{ inputs.image-tag }}"
git config pull.rebase true
git pull && git push -u origin main
32 changes: 14 additions & 18 deletions .github/workflows/dev-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,32 @@ jobs:
if: github.event_name == 'push'
needs: [ prepare-variables ]
name: 이미지 빌드
uses: ./.github/workflows/build-ecr.yaml
uses: ./.github/workflows/build-dockerhub.yaml
permissions:
id-token: write
contents: read
with:
ecr-repository-name: ${{ needs.prepare-variables.outputs.ecr-repository-name }}
image-name: no5ing/bibbi-backend-api-dev
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }}
secrets:
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
AWS_ECR_REGISTRY_URL: ${{ secrets.AWS_ECR_REGISTRY_URL }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_DEV_AUTH_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }}

call-deploy-workflow:
if: github.event_name == 'push'
needs: [ prepare-variables, call-build-workflow ]
name: AWS ECS 배포
uses: ./.github/workflows/deploy-ecs.yaml
name: ArgoCD로 배포하기
uses: ./.github/workflows/deploy-argocd.yaml
permissions:
id-token: write
contents: read
contents: write
with:
argocd-repo-name: bibbi-team/bibbi-argocd-manifest
overlay-name: ${{ needs.prepare-variables.outputs.spring-profile }}
service-name: bibbi-backend-api
image-name: no5ing/bibbi-backend-api-dev
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
environment: development
ecs-service: ${{ needs.prepare-variables.outputs.ecs-service }}
ecs-cluster: ${{ needs.prepare-variables.outputs.ecs-cluster }}
ecr-task-definition: ${{ needs.prepare-variables.outputs.ecr-task-definition }}
image-url: ${{ needs.call-build-workflow.outputs.image-url }}
default-image-name: no5ing/bibbi-backend-api
secrets:
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
AWS_ECR_REGISTRY_URL: ${{ secrets.AWS_ECR_REGISTRY_URL }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
32 changes: 14 additions & 18 deletions .github/workflows/prod-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,32 @@ jobs:
if: github.event_name == 'push'
needs: [ prepare-variables ]
name: 이미지 빌드
uses: ./.github/workflows/build-ecr.yaml
uses: ./.github/workflows/build-dockerhub.yaml
permissions:
id-token: write
contents: read
with:
ecr-repository-name: ${{ needs.prepare-variables.outputs.ecr-repository-name }}
image-name: no5ing/bibbi-backend-api
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }}
secrets:
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
AWS_ECR_REGISTRY_URL: ${{ secrets.AWS_ECR_REGISTRY_URL }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_PROD_AUTH_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }}

call-deploy-workflow:
if: github.event_name == 'push'
needs: [ prepare-variables, call-build-workflow ]
name: AWS ECS 배포
uses: ./.github/workflows/deploy-ecs.yaml
name: ArgoCD로 배포하기
uses: ./.github/workflows/deploy-argocd.yaml
permissions:
id-token: write
contents: read
contents: write
with:
argocd-repo-name: bibbi-team/bibbi-argocd-manifest
overlay-name: ${{ needs.prepare-variables.outputs.spring-profile }}
service-name: bibbi-backend-api
image-name: no5ing/bibbi-backend-api
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
environment: production
ecs-service: ${{ needs.prepare-variables.outputs.ecs-service }}
ecs-cluster: ${{ needs.prepare-variables.outputs.ecs-cluster }}
ecr-task-definition: ${{ needs.prepare-variables.outputs.ecr-task-definition }}
image-url: ${{ needs.call-build-workflow.outputs.image-url }}
default-image-name: no5ing/bibbi-backend-api
secrets:
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
AWS_ECR_REGISTRY_URL: ${{ secrets.AWS_ECR_REGISTRY_URL }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
6 changes: 6 additions & 0 deletions gateway/src/main/java/com/oing/controller/MeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public MemberResponse getMe(String loginMemberId) {
return MemberResponse.of(member);
}

@Override
public FamilyResponse getMyFamily(String loginFamilyId) {
Family family = familyService.getFamilyById(loginFamilyId);
return FamilyResponse.of(family);
}

@Override
public DefaultResponse registerFcmToken(
AddFcmTokenRequest request, String loginMemberId
Expand Down
9 changes: 9 additions & 0 deletions gateway/src/main/java/com/oing/restapi/MeApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.oing.dto.response.DefaultResponse;
import com.oing.dto.response.FamilyResponse;
import com.oing.dto.response.MemberResponse;
import com.oing.util.security.LoginFamilyId;
import com.oing.util.security.LoginMemberId;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down Expand Up @@ -35,6 +36,14 @@ MemberResponse getMe(
String loginMemberId
);

@Operation(summary = "내 가족 정보 조회", description = "내 가족 정보를 조회합니다.")
@GetMapping("/family-info")
FamilyResponse getMyFamily(
@Parameter(hidden = true)
@LoginFamilyId
String loginFamilyId
);

@Operation(summary = "FCM 토큰 등록", description = "FCM 토큰을 등록합니다.")
@PostMapping("/fcm")
DefaultResponse registerFcmToken(
Expand Down
Loading