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

main to apigateway #10

Merged
merged 45 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9a1b82d
[chore] Create gradle.yml
eojinny Feb 8, 2024
0fe2802
[setting] gradle.yml to prod-1-cicd.yml
eojinny Feb 8, 2024
5d1b478
Create prod-2-cicd.yml
eojinny Feb 8, 2024
c442087
Create prod-3-cicid.yml
eojinny Feb 8, 2024
0353939
Rename prod-3-cicid.yml to prod-3-cicd.yml
eojinny Feb 8, 2024
9ed4b34
Update and rename prod-1-cicd.yml to prod-eureka-cicd.yml
eojinny Feb 8, 2024
f281190
Update and rename prod-2-cicd.yml to prod-contents-cicd.yml
eojinny Feb 8, 2024
0847613
Update prod-contents-cicd.yml
eojinny Feb 8, 2024
2ffae7a
Update and rename prod-3-cicd.yml to prod-apigateway-cicd.yml
eojinny Feb 8, 2024
b7055fa
Create prod-keyword-cicd.yml
eojinny Feb 8, 2024
be77932
Rename prod-keyword-cicd.yml to prod-keyword-deploy.yml
eojinny Feb 8, 2024
3066e2f
Rename prod-eureka-cicd.yml to prod-eureka-deploy.yml
eojinny Feb 8, 2024
d999f3c
Rename prod-contents-cicd.yml to prod-contents-deploy.yml
eojinny Feb 8, 2024
9138bfc
Rename prod-apigateway-cicd.yml to prod-apigateway-deploy.yml
eojinny Feb 8, 2024
1f3e801
Create prod-member-deploy.yml
eojinny Feb 8, 2024
5f11b61
Create prod-community-deploy.yml
eojinny Feb 8, 2024
d8ca389
Update prod-member-deploy.yml
eojinny Feb 8, 2024
448a7ea
Create README.md
eojinny Feb 8, 2024
9313b79
Update README.md
eojinny Feb 8, 2024
4e45b0d
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
2951056
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
c0b2e48
Update prod-member-deploy.yml
seungueonn Feb 21, 2024
ccac4a5
Update prod-community-deploy.yml
seungueonn Feb 21, 2024
c4b70c8
Merge pull request #3 from kusitms-28th-Meetup-E/main
seungueonn Feb 21, 2024
6aded25
Update prod-member-deploy.yml
seungueonn Feb 21, 2024
80f108f
Update prod-member-deploy.yml
seungueonn Feb 21, 2024
190b594
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
9d45443
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
862cd0e
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
2d83960
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
1539ea3
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
8b076f6
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
a0c2fca
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
c26c081
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
a93bfdc
Update prod-contents-deploy.yml
eojinny Feb 21, 2024
ff16190
Merge pull request #6 from kusitms-28th-Meetup-E/prod-contents
eojinny Feb 21, 2024
27445c5
Merge pull request #7 from kusitms-28th-Meetup-E/main
eojinny Feb 21, 2024
bde2e44
Update prod-community-deploy.yml
seungueonn Feb 21, 2024
eae34fa
Merge pull request #2 from kusitms-28th-Meetup-E/main
seungueonn Feb 21, 2024
f610efb
Update prod-apigateway-deploy.yml
seungueonn Feb 21, 2024
d8e0bb9
Update prod-eureka-deploy.yml
eojinny Feb 21, 2024
5f1ee75
Update prod-eureka-deploy.yml
eojinny Feb 21, 2024
3ecba04
Merge pull request #8 from kusitms-28th-Meetup-E/prod-eureka
eojinny Feb 21, 2024
af83dbb
Update prod-apigateway-deploy.yml
seungueonn Feb 21, 2024
a1e9663
Merge pull request #9 from kusitms-28th-Meetup-E/prod-community
seungueonn Feb 21, 2024
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
78 changes: 78 additions & 0 deletions .github/workflows/prod-apigateway-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: APIGateway-Service

on:
push:
branches: [ "prod-apigateway" ]
pull_request:
branches: [ "prod-apigateway" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Make application.yml
run: |
cd BE-APIGateway-Server
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_APIGATEWAY }}" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_APIGATEWAY }}

- name: Grant execute permission for gradlew
run: |
cd BE-Member-Server
ls
chmod +x gradlew

- name: Build with Gradle
run: |
cd BE-Member-Server
ls
./gradlew build -x test

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/apigateway:latest
docker push ${{ secrets.DOCKER_USERNAME }}/apigateway:latest

- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST_PROD_1 }}
key: ${{ secrets.PRIVATE_KEY_1 }}
port: ${{ secrets.PORT }}
source: "./BE-APIGateway-Server/docker-compose-apigateway.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_1 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_1 }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/apigateway:latest
docker image prune -a -f
cd ./BE-APIGateway-Server
docker-compose -f docker-compose-apigateway.yml up
71 changes: 71 additions & 0 deletions .github/workflows/prod-community-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: CommunityService

on:
push:
branches: [ "prod-community" ]
pull_request:
branches: [ "prod-community" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Make application.yml
run: |
cd BE-Community-Server
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_COMMUNITY }}" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_COMMUNITY }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/community:latest
docker push ${{ secrets.DOCKER_USERNAME }}/community:latest

- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST }}
key: ${{ secrets.PRIVATE_KEY_3 }}
port: ${{ secrets.PORT }}
source: "./docker-compose-community.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_3 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_3 }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/community:latest
docker image prune -a -f
docker-compose up -d
80 changes: 80 additions & 0 deletions .github/workflows/prod-contents-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: ContentsService

on:
push:
branches: [ "prod-contents" ]
pull_request:
branches: [ "prod-contents" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Clean Gradle Cache
run: |
cd BE-Contents-Server
ls
./gradlew clean

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "$APPLICATION" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_CONTENTS }}

- name: Grant execute permission for gradlew
run: |
cd BE-Contents-Server
ls
chmod +x gradlew

- name: Build with Gradle
run: |
cd BE-Contents-Server
ls
./gradlew build -x test

- name: Docker build
run: |
cd BE-Contents-Server
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/contents:latest
docker push ${{ secrets.DOCKER_USERNAME }}/contents:latest

- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST_PROD_2 }}
key: ${{ secrets.PRIVATE_KEY_CONTENTS }}
port: ${{ secrets.PORT }}
source: "./BE-Contents-Server/docker-compose-contents.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_2 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_CONTENTS }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/contents:latest
docker image prune -a -f
cd ./BE-Contents-Server
docker-compose -f docker-compose-contents.yml up
71 changes: 71 additions & 0 deletions .github/workflows/prod-eureka-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "prod-eureka" ]
pull_request:
branches: [ "prod-eureka" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Clean Gradle Cache
run: |
cd BE-Eureka-Server
ls
./gradlew clean

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "$APPLICATION" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_EUREKA }}

- name: Grant execute permission for gradlew
run: |
cd BE-Eureka-Server
ls
chmod +x gradlew

- name: Build with Gradle
run: |
cd BE-Eureka-Server
ls
./gradlew build -x test

- name: Docker build
run: |
cd BE-Eureka-Server
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/eureka:latest
docker push ${{ secrets.DOCKER_USERNAME }}/eureka:latest

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_1 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_1 }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/eureka:latest
docker stop $(docker ps -a -q)
docker run -d --log-driver=syslog -p 8761:8761 -e SPRING_PROFILES_ACTIVE=prod ${{ secrets.DOCKER_USERNAME }}/eureka:latest
docker rm $(docker ps --filter 'status=exited' -a -q)
docker image prune -a -f
67 changes: 67 additions & 0 deletions .github/workflows/prod-keyword-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "prod-keyword" ]
pull_request:
branches: [ "prod-keyword" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0

- name: Build with Gradle Wrapper
run: ./gradlew build

# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
#
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
# with:
# gradle-version: '8.5'
#
# - name: Build with Gradle 8.5
# run: gradle build

dependency-submission:

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
Loading
Loading