From 1fc4ec876e841fe2cf4fcb308fb4c1acdfe88740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A0=95=EB=AF=BC?= Date: Thu, 1 Aug 2024 09:35:52 +0900 Subject: [PATCH] gitlab runner test --- backend/.gitlab-ci.yml | 23 +++++++++++++++++++ .../user/config/WebConfiguration.java | 2 +- .../edufocus/video/controller/Controller.java | 7 +++--- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 backend/.gitlab-ci.yml diff --git a/backend/.gitlab-ci.yml b/backend/.gitlab-ci.yml new file mode 100644 index 0000000..9761a6c --- /dev/null +++ b/backend/.gitlab-ci.yml @@ -0,0 +1,23 @@ +deploy-to-server: + stage: deploy + only: + - backend + before_script: + - echo 'start deployment' + - whoami + script: + - cd /home/ubuntu/gitlab_runner/ + - git pull origin backend + - cd backend +# - kill $(lsof -t -i:8000) + - ./gradlew build + # - cd /home/ubuntu/s03p12a112/backend/target/ +# - setsid nohup java -jar backend-0.0.1-SNAPSHOT.jar > /dev/null 2>&1 & +# - cd /home/ubuntu/s03p12a112/frontend/ +# - sudo npm install +# - sudo npm run build +# - sudo service nginx restart + after_script: + - echo 'deployment is done' + tags: + - edu \ No newline at end of file diff --git a/backend/src/main/java/com/edufocus/edufocus/user/config/WebConfiguration.java b/backend/src/main/java/com/edufocus/edufocus/user/config/WebConfiguration.java index 3ac277c..f9f5977 100644 --- a/backend/src/main/java/com/edufocus/edufocus/user/config/WebConfiguration.java +++ b/backend/src/main/java/com/edufocus/edufocus/user/config/WebConfiguration.java @@ -21,7 +21,7 @@ public class WebConfiguration implements WebMvcConfigurer { this.jwtInterceptor = jwtInterceptor; } - +// @Override public void addCorsMappings(CorsRegistry registry) { registry diff --git a/backend/src/main/java/com/edufocus/edufocus/video/controller/Controller.java b/backend/src/main/java/com/edufocus/edufocus/video/controller/Controller.java index 99a9494..68d1cb1 100644 --- a/backend/src/main/java/com/edufocus/edufocus/video/controller/Controller.java +++ b/backend/src/main/java/com/edufocus/edufocus/video/controller/Controller.java @@ -98,7 +98,7 @@ public class Controller { Random random = new Random(); - + System.out.println(); int randomNumber = 100 + random.nextInt(9000); String randStr = String.valueOf(randomNumber); @@ -110,8 +110,9 @@ public class Controller { String roomName = lecture.getTitle(); String participantName = userService.getUserName(userId); + System.out.println(participantName); - + System.out.println(participantName+randStr); AccessToken token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET); token.setName(participantName+randStr); token.setIdentity(participantName+randStr); @@ -129,7 +130,7 @@ public class Controller { String roomName = lecture.getTitle(); String participantName = userService.getUserName(userId); - + System.out.println(participantName); AccessToken token = new AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET); token.setName(participantName+randStr);