From d1130a02847ff2c98aa18dfad965a97e86c816a3 Mon Sep 17 00:00:00 2001 From: Sunwu Park <52268188+sunwupark@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:50:31 +0900 Subject: [PATCH] fix: docker-compose.yaml --- .github/workflows/docker.yml | 6 +++--- .../java/umc/meme/shop/ShopApplication.java | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 581ccb9..a95ed9b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,9 +19,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Run chmod to make gradlew executable - run: chmod +x ./gradlew - - name: Set .yml for main run: | # Create resources directory if it doesn't exist @@ -31,6 +28,9 @@ jobs: echo "${{ secrets.MAIN_DATABASE_YML }}" >> ./application.yml shell: bash + - name: Run chmod to make gradlew executable + run: chmod +x ./gradlew + - name: Build with Gradle run: ./gradlew clean build --exclude-task test diff --git a/src/main/java/umc/meme/shop/ShopApplication.java b/src/main/java/umc/meme/shop/ShopApplication.java index e4d47bc..fe1392c 100644 --- a/src/main/java/umc/meme/shop/ShopApplication.java +++ b/src/main/java/umc/meme/shop/ShopApplication.java @@ -3,12 +3,29 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; + +import java.io.IOException; + @SpringBootApplication @EnableJpaAuditing public class ShopApplication { - public static void main(String[] args) { + public static void main(String[] args) throws IOException { + ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + + // Resolve the resource for the current file + Resource resource = resolver.getResource("classpath:"); + + // Get the absolute path of the current file + String absolutePath = resource.getFile().getAbsolutePath(); + + // Print the absolute path + System.out.println("Absolute path to the current file: " + absolutePath); + SpringApplication.run(ShopApplication.class, args); }