-
Notifications
You must be signed in to change notification settings - Fork 1
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 #35 from KERT-core/release
Release v1.0.0
- Loading branch information
Showing
56 changed files
with
2,907 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
if: ${{ github.event_name == 'push' && github.actor != 'github-actions[bot]' }} | ||
runs-on: 'self-hosted' | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
- name: Build with Gradle Wrapper | ||
run: | | ||
chmod +x ./gradlew | ||
./gradlew clean build -x test | ||
- name: Stop running service | ||
run: docker compose down be --rmi local | ||
|
||
- name: Start service | ||
run: docker compose up be -d | ||
|
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,86 @@ | ||
# 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: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
#path에 gradle/caches 생기는대로 추가 예정 | ||
- name: Cache Gradle | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Generate Environment Variables File | ||
run: | | ||
echo "JWT_SECRET=$JWT_SECRET" >> .env | ||
env: | ||
JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
|
||
# Configure Gradle for optimal use in GitHub 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@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||
|
||
- name: Build with Gradle Wrapper | ||
run: | | ||
chmod +x ./gradlew | ||
./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@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||
# with: | ||
# gradle-version: '8.9' | ||
# | ||
# - name: Build with Gradle 8.9 | ||
# 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@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 |
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,19 @@ | ||
FROM bellsoft/liberica-openjdk-alpine:17 | ||
|
||
CMD ["./gradlew", "clean", "build"] | ||
|
||
VOLUME /tmp | ||
|
||
ARG JAR_FILE=build/libs/*-SNAPSHOT.jar | ||
|
||
ENV DOCKERIZE_VERSION v0.8.0 | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
COPY ${JAR_FILE} app.jar | ||
COPY docker-entrypoint.sh docker-entrypoint.sh | ||
|
||
RUN touch .env | ||
|
||
RUN chmod +x docker-entrypoint.sh | ||
ENTRYPOINT ./docker-entrypoint.sh |
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 |
---|---|---|
|
@@ -107,4 +107,4 @@ git push origin dev | |
|
||
## 사용하는 프레임워크/라이브러리 | ||
|
||
### SpringBoot 3.3.2 + MySQL | ||
### SpringBoot 3.3.5 + MySQL |
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,5 @@ | ||
echo "wait mysql server" | ||
dockerize -wait tcp://kiw_mysql:3306 -timeout 20s | ||
|
||
echo "start spring boot server" | ||
java -jar /app.jar |
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,31 @@ | ||
### GET request | ||
GET localhost:8080/admin | ||
Content-Type: application/json | ||
|
||
### POST request | ||
POST localhost:8080/admin | ||
Content-Type: application/json | ||
|
||
{ | ||
"student_id": 2024123456, | ||
"generation": "2022.1", | ||
"role": "president", | ||
"description": "I am the president of the student council." | ||
} | ||
|
||
### GET request | ||
GET localhost:8080/admin/2024123456 | ||
|
||
### PUT request | ||
PUT localhost:8080/admin/2024123456 | ||
Content-Type: application/json | ||
|
||
{ | ||
"student_id": 2024123456, | ||
"generation": "2022.1", | ||
"role": "vice-president", | ||
"description": "I am the vice-president of the student council." | ||
} | ||
|
||
### DELETE request | ||
DELETE localhost:8080/admin/2024123456 |
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,84 @@ | ||
### GET request | ||
GET localhost:8080/users | ||
Content-Type: application/json | ||
|
||
### POST request | ||
POST localhost:8080/users | ||
Content-Type: application/json | ||
|
||
{ | ||
"student_id": 2024123456, | ||
"name": "홍길동", | ||
"email": "[email protected]", | ||
"profile_picture": "https://example.com/knu.jpg", | ||
"generation": "2022.1", | ||
"major": "asdf" | ||
} | ||
|
||
### POST request | ||
GET localhost:8080/users/2024123456 | ||
|
||
### PUT request | ||
PUT localhost:8080/users/2024123456 | ||
Content-Type: application/json | ||
|
||
{ | ||
"name": "심청이", | ||
"email": "[email protected]", | ||
"profile_picture": "https://example.com/simcom.jpg", | ||
"generation": "2022.1", | ||
"major": "심컴" | ||
} | ||
|
||
### DELETE request | ||
DELETE localhost:8080/users/2024123456 | ||
|
||
### Signup | ||
POST http://localhost:8080/users/signup | ||
Content-Type: application/json | ||
|
||
{ | ||
"studentId": 2024123456, | ||
"name": "홍길동", | ||
"email": "[email protected]", | ||
"profilePicture": "https://example.com/knu.jpg", | ||
"generation": "2022.1", | ||
"major": "asdf", | ||
"password": "password123" | ||
} | ||
|
||
### | ||
|
||
### Login | ||
POST http://localhost:8080/users/login | ||
Content-Type: application/json | ||
|
||
{ | ||
"studentId": 2024123456, | ||
"password": "password123" | ||
} | ||
|
||
### | ||
|
||
### Get All Users | ||
GET http://localhost:8080/users | ||
|
||
### | ||
|
||
### Get User by ID | ||
GET http://localhost:8080/users/1 | ||
|
||
### | ||
|
||
### Update User | ||
PUT http://localhost:8080/users/1 | ||
Content-Type: application/json | ||
|
||
{ | ||
"name": "John Doe Updated" | ||
} | ||
|
||
### | ||
|
||
### Delete User | ||
DELETE http://localhost:8080/users/1 |
Binary file not shown.
Oops, something went wrong.