Skip to content

Commit

Permalink
Merge pull request #99 from APPS-sookmyung/hotfix/spring-restdocs-cicd
Browse files Browse the repository at this point in the history
[hotfix/spring-restdocs-cicd] 프로젝트 구조 변경 및 cicd 세팅 변경
  • Loading branch information
5jisoo authored Jan 21, 2024
2 parents 9fac320 + 1157c3e commit 6165128
Show file tree
Hide file tree
Showing 113 changed files with 1,357 additions and 43 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ env:
S3_BUCKET_NAME: pochak-github-actions-s3-bucket
CODE_DEPLOY_APPLICATION_NAME: pochakapp-codedeploy
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: pochak-develop_instance

PROJECT_NAME: pochak-develop
RESOURCE_PATH: ./pochak/src/main/resources


permissions:
contents: read

jobs:
deploy:
Expand All @@ -35,33 +29,34 @@ jobs:

# 설정파일
- name: add api key file
run: echo "${{ secrets.DEV_API_KEY }}" > /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak/src/main/resources/application-API-KEY.properties
run: echo "${{ secrets.DEV_API_KEY }}" > ./src/main/resources/application-API-KEY.properties
shell: bash

- name: add jwt file
run: echo "${{ secrets.DEV_JWT }}" > /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak/src/main/resources/application-JWT.properties
run: echo "${{ secrets.DEV_JWT }}" > ./src/main/resources/application-JWT.properties
shell: bash

- name: add oauth file
run: echo "${{ secrets.DEV_OAUTH }}" > /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak/src/main/resources/application-OAUTH.properties
run: echo "${{ secrets.DEV_OAUTH }}" > ./src/main/resources/application-OAUTH.properties
shell: bash

- name: add test setting file
run: echo "${{ secrets.DEV_TEST }}" > /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak/src/test/resources/application-TEST.properties
run: echo "${{ secrets.DEV_TEST }}" > ./src/test/resources/application-TEST.properties
shell: bash

- name: add authkey file
run: echo "${{ secrets.DEV_AUTHKEY }}" > /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak/src/main/resources/static/AuthKey_D5ZQTHUQ4K.p8
run: echo "${{ secrets.DEV_AUTHKEY }}" > ./src/main/resources/static/AuthKey_D5ZQTHUQ4K.p8
shell: bash

- name: gradlew에 실행 권한 부여
run: chmod +x ./pochak/gradlew
run: chmod +x ./gradlew
shell : bash

- name: Test with Gradle
run: ./gradlew test

- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
build-root-directory: /home/runner/work/2023-POCHAK-server/2023-POCHAK-server/pochak
run: ./gradlew build

- name: Make zip file
run: zip -qq -r ./$GITHUB_SHA.zip .
Expand Down
1 change: 1 addition & 0 deletions pochak/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build/
!**/src/test/**/build/

# ignore files
.idea
.tmp
dists
caches
Expand Down
28 changes: 27 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 2 additions & 22 deletions pochak/build.gradle → build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ ext {
snippetsDir = file('build/generated-snippets')
}


asciidoctor {
dependsOn test
configurations 'asciidoctorExt'
Expand All @@ -74,28 +73,9 @@ asciidoctor.doFirst {

bootJar {
dependsOn asciidoctor
}

tasks.register('copyApiDocument') {
dependsOn asciidoctor
copy {
from "${asciidoctor.outputDir}"
into 'BOOT-INF/classes/static/docs'
}
println "output Dir checking -- ${asciidoctor.outputDir}"
copy {
from "${asciidoctor.outputDir}"
from("${asciidoctor.outputDir}")
into 'src/main/resources/static/docs'
}
copy {
from file("build/docs/asciidoc")
into file("BOOT-INF/classes/static/docs")
}
copy {
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}
}

build {
dependsOn copyApiDocument
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TIME_NOW=$(date +%c)

# build 파일 복사
echo "$TIME_NOW > $JAR_PATH 확인" >> $DEPLOY_LOG
JAR_NAME=$(ls $PROJECT_ROOT/pochak/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1)
JAR_PATH=$PROJECT_ROOT/pochak/build/libs/$JAR_NAME
JAR_NAME=$(ls $PROJECT_ROOT/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1)
JAR_PATH=$PROJECT_ROOT/build/libs/$JAR_NAME

CURRENT_PID=$(pgrep -f $JAR_NAME)

Expand Down
4 changes: 2 additions & 2 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

PROJECT_ROOT="/home/ubuntu/pochakapp"
JAR_FILE="$PROJECT_ROOT/pochak/build/libs/pochak-0.0.1-SNAPSHOT.jar"
JAR_ROOT="$PROJECT_ROOT/pochak/build/libs/"
JAR_FILE="$PROJECT_ROOT/build/libs/pochak-0.0.1-SNAPSHOT.jar"
JAR_ROOT="$PROJECT_ROOT/build/libs/"

DEPLOY_LOG="$PROJECT_ROOT/deploy.log"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Loading

0 comments on commit 6165128

Please sign in to comment.