diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..f495cdf --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,16 @@ +FROM public.ecr.aws/sam/build-java17:1.108.0-20240123221230 as build-image +WORKDIR "/task" +COPY src src/ +COPY gradle gradle/ +COPY gradlew ./ +COPY gradlew.bat ./ +COPY build.gradle ./ +COPY settings.gradle ./ +RUN ./gradlew clean assemble + +FROM public.ecr.aws/docker/library/amazoncorretto:17.0.10-alpine3.19 +COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.1 /lambda-adapter /opt/extensions/lambda-adapter +EXPOSE 8080 +WORKDIR /opt +COPY --from=build-image /task/build/libs/mrls-2.0.0.jar /opt +CMD ["java", "-jar", "mrls-2.0.0.jar"] \ No newline at end of file diff --git a/build.gradle b/app/build.gradle similarity index 63% rename from build.gradle rename to app/build.gradle index b0ba5b9..a14f7b2 100644 --- a/build.gradle +++ b/app/build.gradle @@ -1,11 +1,11 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.0.1' + id 'org.springframework.boot' version '3.2.2' id 'io.spring.dependency-management' version '1.1.0' } group = 'io.github.tttol' -version = "1.1.6" +version = "2.0.0" sourceCompatibility = '17' configurations { @@ -32,3 +32,22 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +// sourceSets { +// main { +// java { +// srcDirs = ['app/src/main/java'] +// resources { +// srcDirs = ['app/src/main/resources'] +// } +// } +// } +// test { +// java { +// srcDirs = ['app/src/test/java'] +// resources { +// srcDirs = ['app/src/test/resources'] +// } +// } +// } +// } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from gradle/wrapper/gradle-wrapper.jar rename to app/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties similarity index 93% rename from gradle/wrapper/gradle-wrapper.properties rename to app/gradle/wrapper/gradle-wrapper.properties index 070cb70..a595206 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/app/gradlew similarity index 100% rename from gradlew rename to app/gradlew diff --git a/gradlew.bat b/app/gradlew.bat similarity index 100% rename from gradlew.bat rename to app/gradlew.bat diff --git a/settings.gradle b/app/settings.gradle similarity index 100% rename from settings.gradle rename to app/settings.gradle diff --git a/src/main/java/io/github/tttol/mrls/MrlsApplication.java b/app/src/main/java/io/github/tttol/mrls/MrlsApplication.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/MrlsApplication.java rename to app/src/main/java/io/github/tttol/mrls/MrlsApplication.java diff --git a/src/main/java/io/github/tttol/mrls/config/RestTemplateConfig.java b/app/src/main/java/io/github/tttol/mrls/config/RestTemplateConfig.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/config/RestTemplateConfig.java rename to app/src/main/java/io/github/tttol/mrls/config/RestTemplateConfig.java diff --git a/src/main/java/io/github/tttol/mrls/controller/MrListController.java b/app/src/main/java/io/github/tttol/mrls/controller/MrListController.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/controller/MrListController.java rename to app/src/main/java/io/github/tttol/mrls/controller/MrListController.java diff --git a/src/main/java/io/github/tttol/mrls/dto/GitLabMergeRequestApiResponseDto.java b/app/src/main/java/io/github/tttol/mrls/dto/GitLabMergeRequestApiResponseDto.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/dto/GitLabMergeRequestApiResponseDto.java rename to app/src/main/java/io/github/tttol/mrls/dto/GitLabMergeRequestApiResponseDto.java diff --git a/src/main/java/io/github/tttol/mrls/dto/UserDto.java b/app/src/main/java/io/github/tttol/mrls/dto/UserDto.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/dto/UserDto.java rename to app/src/main/java/io/github/tttol/mrls/dto/UserDto.java diff --git a/src/main/java/io/github/tttol/mrls/exception/GitLabApiException.java b/app/src/main/java/io/github/tttol/mrls/exception/GitLabApiException.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/exception/GitLabApiException.java rename to app/src/main/java/io/github/tttol/mrls/exception/GitLabApiException.java diff --git a/src/main/java/io/github/tttol/mrls/external/GitLabApiExecutor.java b/app/src/main/java/io/github/tttol/mrls/external/GitLabApiExecutor.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/external/GitLabApiExecutor.java rename to app/src/main/java/io/github/tttol/mrls/external/GitLabApiExecutor.java diff --git a/src/main/java/io/github/tttol/mrls/form/MrDetailForm.java b/app/src/main/java/io/github/tttol/mrls/form/MrDetailForm.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/form/MrDetailForm.java rename to app/src/main/java/io/github/tttol/mrls/form/MrDetailForm.java diff --git a/src/main/java/io/github/tttol/mrls/form/MrInfoForm.java b/app/src/main/java/io/github/tttol/mrls/form/MrInfoForm.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/form/MrInfoForm.java rename to app/src/main/java/io/github/tttol/mrls/form/MrInfoForm.java diff --git a/src/main/java/io/github/tttol/mrls/form/UserForm.java b/app/src/main/java/io/github/tttol/mrls/form/UserForm.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/form/UserForm.java rename to app/src/main/java/io/github/tttol/mrls/form/UserForm.java diff --git a/src/main/java/io/github/tttol/mrls/handler/ApiExceptionHandler.java b/app/src/main/java/io/github/tttol/mrls/handler/ApiExceptionHandler.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/handler/ApiExceptionHandler.java rename to app/src/main/java/io/github/tttol/mrls/handler/ApiExceptionHandler.java diff --git a/src/main/java/io/github/tttol/mrls/service/MergeRequestService.java b/app/src/main/java/io/github/tttol/mrls/service/MergeRequestService.java similarity index 100% rename from src/main/java/io/github/tttol/mrls/service/MergeRequestService.java rename to app/src/main/java/io/github/tttol/mrls/service/MergeRequestService.java diff --git a/src/main/resources/application-env.yml b/app/src/main/resources/application-env.yml similarity index 100% rename from src/main/resources/application-env.yml rename to app/src/main/resources/application-env.yml diff --git a/src/main/resources/application.yml b/app/src/main/resources/application.yml similarity index 71% rename from src/main/resources/application.yml rename to app/src/main/resources/application.yml index c507b62..8ebc773 100644 --- a/src/main/resources/application.yml +++ b/app/src/main/resources/application.yml @@ -1,9 +1,9 @@ app: gitlab: - host: ${GITLAB_HOST} + host: host project: - id: ${GITLAB_PROJECT_ID} - accessToken: ${GITLAB_ACCESS_TOKEN} + id: id + accessToken: token api: endpoint: https://${app.gitlab.host}/api/v4/projects/${app.gitlab.project.id}/merge_requests?state=opened logging: diff --git a/src/main/resources/static/css/list.css b/app/src/main/resources/static/css/list.css similarity index 100% rename from src/main/resources/static/css/list.css rename to app/src/main/resources/static/css/list.css diff --git a/src/main/resources/static/img/page-sample.png b/app/src/main/resources/static/img/page-sample.png similarity index 100% rename from src/main/resources/static/img/page-sample.png rename to app/src/main/resources/static/img/page-sample.png diff --git a/src/main/resources/templates/apiError.html b/app/src/main/resources/templates/apiError.html similarity index 100% rename from src/main/resources/templates/apiError.html rename to app/src/main/resources/templates/apiError.html diff --git a/src/main/resources/templates/fragment/footer.html b/app/src/main/resources/templates/fragment/footer.html similarity index 100% rename from src/main/resources/templates/fragment/footer.html rename to app/src/main/resources/templates/fragment/footer.html diff --git a/src/main/resources/templates/fragment/header.html b/app/src/main/resources/templates/fragment/header.html similarity index 100% rename from src/main/resources/templates/fragment/header.html rename to app/src/main/resources/templates/fragment/header.html diff --git a/src/main/resources/templates/list.html b/app/src/main/resources/templates/list.html similarity index 100% rename from src/main/resources/templates/list.html rename to app/src/main/resources/templates/list.html diff --git a/src/test/java/io/github/tttol/mrls/MrlsApplicationTests.java b/app/src/test/java/io/github/tttol/mrls/MrlsApplicationTests.java similarity index 100% rename from src/test/java/io/github/tttol/mrls/MrlsApplicationTests.java rename to app/src/test/java/io/github/tttol/mrls/MrlsApplicationTests.java diff --git a/src/test/java/io/github/tttol/mrls/controller/MrListControllerTest.java b/app/src/test/java/io/github/tttol/mrls/controller/MrListControllerTest.java similarity index 100% rename from src/test/java/io/github/tttol/mrls/controller/MrListControllerTest.java rename to app/src/test/java/io/github/tttol/mrls/controller/MrListControllerTest.java diff --git a/src/test/java/io/github/tttol/mrls/service/MergeRequestServiceTest.java b/app/src/test/java/io/github/tttol/mrls/service/MergeRequestServiceTest.java similarity index 100% rename from src/test/java/io/github/tttol/mrls/service/MergeRequestServiceTest.java rename to app/src/test/java/io/github/tttol/mrls/service/MergeRequestServiceTest.java diff --git a/version.properties b/version.properties deleted file mode 100644 index a97812e..0000000 --- a/version.properties +++ /dev/null @@ -1 +0,0 @@ -appVersion=1.1.6 \ No newline at end of file