-
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 branch 'main' of https://github.com/goormthon-Univ/2024_BEOTKKO…
…TTHON_TEAM_32_BE into develope
- Loading branch information
Showing
10 changed files
with
153 additions
and
56 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 |
---|---|---|
|
@@ -47,57 +47,72 @@ jobs: | |
- name: Build with Gradle | ||
run: ./gradlew build -x test | ||
|
||
- name: Prepare keystore | ||
run: echo "${{ secrets.KEYSTORE }}" > keystore.p12 | ||
|
||
- name: Move keystore file to Docker build context | ||
run: mv keystore.p12 src/main/resources/ | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to NCP Container Registry | ||
uses: docker/login-action@v2 | ||
# Record test results as comments in PR | ||
- name: Write test results in comments to Pull Request | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
username: ${{ secrets.NCP_ACCESS_KEY }} | ||
password: ${{ secrets.NCP_SECRET_KEY }} | ||
files: '**/build/test-results/test/TEST-*.xml' | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | ||
cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | ||
cache-to: type=inline | ||
secrets: | | ||
GIT_AUTH_TOKEN=${{ secrets.GIT_TOKEN }} | ||
- name: Connect to Server and Pull from Container Registry | ||
uses: appleboy/[email protected] | ||
# If a test fails, write a check comment to the failed code line | ||
- name: If a test fails, write a check comment to the failed code line | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() | ||
with: | ||
host: ${{ secrets.NCP_SERVER_IP }} | ||
username: ${{ secrets.NCP_SERVER_USERNAME }} | ||
password: ${{ secrets.NCP_SERVER_PASSWORD }} | ||
port: ${{ secrets.NCP_SERVER_PORT }} | ||
script: | | ||
echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u ${{ secrets.NCP_ACCESS_KEY }} --password-stdin ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
report_paths: '**/build/test-results/test/TEST-*.xml' | ||
token: ${{ github.token }} | ||
|
||
# - name: Prepare keystore | ||
# run: echo "${{ secrets.KEYSTORE }}" > keystore.p12 | ||
|
||
# - name: Move keystore file to Docker build context | ||
# run: mv keystore.p12 src/main/resources/ | ||
|
||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
|
||
# - name: Login to NCP Container Registry | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
# username: ${{ secrets.NCP_ACCESS_KEY }} | ||
# password: ${{ secrets.NCP_SECRET_KEY }} | ||
|
||
# - name: Build and Push Docker Image | ||
# uses: docker/build-push-action@v3 | ||
# with: | ||
# context: . | ||
# file: ./Dockerfile | ||
# push: true | ||
# tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | ||
# cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | ||
# cache-to: type=inline | ||
# secrets: | | ||
# GIT_AUTH_TOKEN=${{ secrets.GIT_TOKEN }} | ||
|
||
# - name: Connect to Server and Pull from Container Registry | ||
# uses: appleboy/[email protected] | ||
# with: | ||
# host: ${{ secrets.NCP_SERVER_IP }} | ||
# username: ${{ secrets.NCP_SERVER_USERNAME }} | ||
# password: ${{ secrets.NCP_SERVER_PASSWORD }} | ||
# port: ${{ secrets.NCP_SERVER_PORT }} | ||
# script: | | ||
# echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u ${{ secrets.NCP_ACCESS_KEY }} --password-stdin ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
|
||
latest_tag=$(docker pull --quiet ${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | grep -oP "(?<=digest: ).*") | ||
# latest_tag=$(docker pull --quiet ${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:latest | grep -oP "(?<=digest: ).*") | ||
|
||
echo "-----------------Latest tag found: ${{ secrets.LATEST_TAG }}" | ||
# echo "-----------------Latest tag found: ${{ secrets.LATEST_TAG }}" | ||
|
||
container_id=$(docker ps -aq) | ||
# container_id=$(docker ps -aq) | ||
|
||
if [ ! -z "$container_id" ]; then | ||
docker stop $container_id | ||
docker rm $container_id | ||
fi | ||
# if [ ! -z "$container_id" ]; then | ||
# docker stop $container_id | ||
# docker rm $container_id | ||
# fi | ||
|
||
docker run -d -p 443:443 | ||
${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:${{ secrets.LATEST_TAG }} | ||
# docker run -d -p 443:443 | ||
# ${{ secrets.NCP_CONTAINER_REGISTRY }}/balpyo-server:${{ secrets.LATEST_TAG }} | ||
|
||
|
||
docker image prune -f | ||
# 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
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 |
---|---|---|
|
@@ -9,5 +9,4 @@ public class UIDResponse { | |
|
||
private String uid; | ||
|
||
|
||
} |
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,15 +1,18 @@ | ||
package site.balpyo.script.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.*; | ||
|
||
@Data | ||
@Getter | ||
@Setter | ||
@Builder | ||
@AllArgsConstructor | ||
public class ScriptResponse { | ||
|
||
|
||
private Long scriptId; | ||
private String script; | ||
private String gptId; | ||
private String uid; | ||
private String title; | ||
private Integer secTime; | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/site/balpyo/script/repository/ScriptRepository.java
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,7 +1,14 @@ | ||
package site.balpyo.script.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import site.balpyo.script.entity.ScriptEntity; | ||
|
||
import java.util.Optional; | ||
|
||
public interface ScriptRepository extends JpaRepository<ScriptEntity, Long> { | ||
@Query("SELECT s FROM ScriptEntity s WHERE s.guestEntity.uid = :uid AND s.script_id = :scriptId") | ||
Optional<ScriptEntity> findScriptByGuestUidAndScriptId(@Param("uid") String uid, @Param("scriptId") Long scriptId); | ||
|
||
} |
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