-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from Myongji-Graduate/develop
졸업을 부탁해 v2
- Loading branch information
Showing
439 changed files
with
15,375 additions
and
6,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,60 @@ | ||
name: Deploy | ||
name: Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
env: | ||
S3_BUCKET_NAME: gitaction-s3-bucket | ||
RESOURCE_PATH: ./src/main/resources/application.yml | ||
CODE_DEPLOY_APPLICATION_NAME: pg-webservice-codeploy | ||
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: pg-webservice-codedeploy-prod-group | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Set yaml file | ||
uses: microsoft/variable-substitution@v1 | ||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
files: ${{ env.RESOURCE_PATH }} | ||
env: | ||
spring.datasource.url: ${{secrets.DB_URL}} | ||
spring.datasource.username: ${{secrets.DB_USERNAME}} | ||
spring.datasource.password: ${{secrets.DB_PASSWORD}} | ||
server.port: ${{secrets.PORT}} | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
shell: bash | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
shell: bash | ||
|
||
- name: Make zip file | ||
run: zip -r ./$GITHUB_SHA.zip . | ||
shell: bash | ||
run: chmod +x gradlew | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip | ||
- name: Build with gradle | ||
run : ./gradlew build -x test -x asciidoctor | ||
|
||
- name: Code Deploy | ||
- name: Build Docker image | ||
run: | | ||
aws deploy create-deployment \ | ||
--deployment-config-name CodeDeployDefault.AllAtOnce \ | ||
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \ | ||
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \ | ||
--s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$GITHUB_SHA.zip | ||
docker login -u ${{ secrets.DOCKERHUB_ID }} -p ${{ secrets.DOCKERHUB_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 \ | ||
--build-arg DATASOURCE_URL=${{ secrets.DATASOURCE_URL }} \ | ||
--build-arg DATASOURCE_USERNAME=${{ secrets.DATASOURCE_USERNAME }} \ | ||
--build-arg DATASOURCE_PASSWORD=${{ secrets.DATASOURCE_PASSWORD }} \ | ||
--build-arg JWT_SECRET=${{ secrets.JWT_SECRET }} . | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 | ||
- name: Docker Deploy executing remote ssh commands using ssh_key | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.WAS_HOST }} | ||
username: ${{ secrets.WAS_USERNAME }} | ||
key: ${{ secrets.WAS_KEY }} | ||
script : | | ||
cd ~/mju-graduate-server | ||
docker stop $(docker ps -a -q) | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 | ||
docker rm -f $(docker ps -a -q) | ||
docker run -d --name mju-graduate-server -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 | ||
docker image prune -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ name: Test & Jacoco Code Coverage | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ main, develop ] | ||
pull_request: | ||
branches: [ main ] # master branch에 PR을 보낼 때 실행 | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
test: | ||
|
@@ -19,15 +19,15 @@ jobs: | |
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Set yaml file | ||
uses: microsoft/variable-substitution@v1 | ||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
files: ./src/main/resources/application.yml | ||
env: | ||
spring.datasource.url: ${{secrets.DB_URL}} | ||
spring.datasource.username: ${{secrets.DB_USERNAME}} | ||
spring.datasource.password: ${{secrets.DB_PASSWORD}} | ||
server.port: ${{secrets.PORT}} | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# Gradle wrapper 파일 실행 권한주기 | ||
- name: Grant execute permission for gradlew | ||
|
@@ -38,5 +38,5 @@ jobs: | |
run: ./gradlew build jacocoTestReport | ||
|
||
# report 업로드하기 | ||
- name: Upload coverage to Codecv | ||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM openjdk:11 | ||
|
||
ARG JAR_FILE=build/libs/*.jar | ||
ARG PROFILE=prod | ||
ARG DATASOURCE_URL | ||
ARG DATASOURCE_USERNAME | ||
ARG DATASOURCE_PASSWORD | ||
ARG JWT_SECRET | ||
|
||
COPY ${JAR_FILE} app.jar | ||
|
||
ENV PROFILE=${PROFILE} | ||
ENV DATASOURCE_URL=${DATASOURCE_URL} | ||
ENV DATASOURCE_USERNAME=${DATASOURCE_USERNAME} | ||
ENV DATASOURCE_PASSWORD=${DATASOURCE_PASSWORD} | ||
ENV JWT_SECRET=${JWT_SECRET} | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=${PROFILE}", "/app.jar"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.