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

CI/CD 구축 #94

Merged
merged 3 commits into from
Aug 19, 2023
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
20 changes: 13 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: cvsgo-server-group

jobs:
build:
test_and_build:
runs-on: ubuntu-latest

steps:
Expand All @@ -29,17 +29,24 @@ jobs:

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

- name: Controller Test with Gradle
run: ./gradlew test --tests "com.cvsgo.controller.*"


- name: Controller and Service Tests with Gradle
run: |
./gradlew test --tests "com.cvsgo.controller.*"
./gradlew test --tests "com.cvsgo.service.*"

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

- name: Make zip file
run: zip -qq -r ./$GITHUB_SHA.zip .
shell: bash


deploy:
runs-on: ubuntu-latest
needs: test_and_build

steps:
- name: AWS Configure credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -56,4 +63,3 @@ jobs:
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }}
--deployment-config-name CodeDeployDefault.AllAtOnce
--s3-location bucket=$S3_BUCKET_NAME,key=$PROJECT_NAME/$GITHUB_SHA.zip,bundleType=zip

27 changes: 27 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Tests on Develop

on:
pull_request:
branches: [ "develop" ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

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

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

- name: Controller and Service Tests with Gradle
run: |
./gradlew test --tests "com.cvsgo.controller.*"
./gradlew test --tests "com.cvsgo.service.*"
1 change: 1 addition & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ files:
- source: /
destination: /home/ubuntu/cvs-go-server
overwrite: yes
file_exists_behavior: OVERWRITE

permissions:
- object: /home/ubuntu/cvs-go-server
Expand Down