-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 331078f
Showing
56 changed files
with
2,074 additions
and
0 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,14 @@ | ||
root = true | ||
|
||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
indent_style=space | ||
indent_size=4 | ||
insert_final_newline=true | ||
disabled_rules=no-wildcard-imports,import-ordering,comment-spacing | ||
|
||
[*.{kt,kts}] | ||
insert_final_newline=false | ||
# enable trailing_comma | ||
ij_kotlin_allow_trailing_comma=true |
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,26 @@ | ||
🎫 연관 티켓 | ||
--- | ||
#연관티켓이슈번호 | ||
|
||
🙏 작업 | ||
---- | ||
- 작업1 | ||
- 작업2 | ||
|
||
💁♂️ 어떻게? | ||
---- | ||
- 작업1 어떻게? | ||
- 작업2 어떻게? | ||
|
||
🙈 PR 참고 사항 | ||
---- | ||
- 질문? | ||
- 추가 티켓 | ||
|
||
📸 스크린샷 | ||
---- | ||
|
||
🤖 테스트 체크리스트 | ||
---- | ||
- [ ] 체크 미완료 | ||
- [x] 체크 완료 |
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,80 @@ | ||
name: DEV - Deploy to Amazon ECS | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- traffic | ||
workflow_dispatch: | ||
env: | ||
AWS_REGION: ap-northeast-2 | ||
ECR_REPOSITORY: tf-ecr | ||
ECS_SERVICE: tf-ecs-service | ||
ECS_CLUSTER: tf-ecs-cluster | ||
ECS_TASK_DEFINITION: task-definition.json | ||
TASK_DEFINITION_NAME: tf-ecs-task | ||
CONTAINER_NAME: tf-container | ||
|
||
jobs: | ||
build-and-push-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: gradle | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle bootBuildImage, tag, and push image to Amazon ECR | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
run: | | ||
GIT_HASH=$(git rev-parse --short HEAD) | ||
./gradlew buildDockerImage -PimageName=${ECR_REGISTRY}/${ECR_REPOSITORY}:latest | ||
docker tag ${ECR_REGISTRY}/${ECR_REPOSITORY}:latest ${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH} | ||
docker push ${ECR_REGISTRY}/${ECR_REPOSITORY} --all-tags | ||
- name: Get ECR Repository image path | ||
id: get-docker-image-path | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
run: | | ||
GIT_HASH=$(git rev-parse --short HEAD) | ||
echo ${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH} | ||
echo "::set-output name=image::${ECR_REGISTRY}/${ECR_REPOSITORY}:${GIT_HASH}" | ||
- name: Download task definition | ||
run: | | ||
aws ecs describe-task-definition --task-definition ${TASK_DEFINITION_NAME} --query taskDefinition > task-definition.json | ||
- name: Fill in the new image ID in the Amazon ECS task definition | ||
id: task-definition | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: ${{ env.ECS_TASK_DEFINITION }} | ||
container-name: ${{ env.CONTAINER_NAME }} | ||
image: ${{ steps.get-docker-image-path.outputs.image }} | ||
|
||
- name: Deploy Amazon ECS task definition | ||
id: ecs-deployment | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-definition.outputs.task-definition }} | ||
service: ${{ env.ECS_SERVICE }} | ||
cluster: ${{ env.ECS_CLUSTER }} | ||
wait-for-service-stability: true |
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,21 @@ | ||
name: lint | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Test with Spotless | ||
run: ./gradlew --info spotlessJavaCheck |
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,40 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Kotlin ### | ||
.kotlin |
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,17 @@ | ||
FROM openjdk:18-oracle | ||
|
||
RUN mkdir -p /logs | ||
|
||
ENV PROFILE default | ||
ENV TZ=Asia/Seoul | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS | ||
|
||
ARG RELEASE_VERSION | ||
ENV DD_VERSION=${RELEASE_VERSION} | ||
|
||
ARG JAR_FILE="build/libs/walking-traffic-0.0.1-SNAPSHOT.jar" | ||
COPY ${JAR_FILE} app.jar | ||
|
||
ENTRYPOINT java -XX:MaxGCPauseMillis=100 -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 $JAVA_OPTS -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,115 @@ | ||
import java.util.* | ||
|
||
plugins { | ||
id("org.springframework.boot") version "3.1.5" | ||
id("io.spring.dependency-management") version "1.1.6" | ||
|
||
kotlin("jvm") version "1.9.25" | ||
kotlin("plugin.spring") version "1.9.25" | ||
kotlin("plugin.jpa") version "1.9.25" | ||
kotlin("plugin.allopen") version "1.9.25" | ||
kotlin("kapt") version "1.9.25" | ||
idea | ||
|
||
id("org.jlleitschuh.gradle.ktlint") version "11.6.1" | ||
} | ||
|
||
group = "com.walking" | ||
version = "0.0.1-SNAPSHOT" | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
/** | ||
* https://kotlinlang.org/docs/reference/compiler-plugins.html#spring-support | ||
* automatically supported annotation | ||
* @Component, @Async, @Transactional, @Cacheable, @SpringBootTest, | ||
* @Configuration, @Controller, @RestController, @Service, @Repository. | ||
* jpa meta-annotations not automatically opened through the default settings of the plugin.spring | ||
*/ | ||
allOpen { | ||
annotation("javax.persistence.Entity") | ||
annotation("javax.persistence.Embeddable") | ||
annotation("javax.persistence.MappedSuperclass") | ||
} | ||
|
||
dependencies { | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("org.springframework.boot:spring-boot-starter-data-jpa") | ||
implementation("org.springframework.boot:spring-boot-starter-validation") | ||
implementation("org.springframework.boot:spring-boot-starter-batch") | ||
implementation("org.springframework.boot:spring-boot-starter-quartz") | ||
|
||
implementation("com.mysql:mysql-connector-j") | ||
implementation("org.hibernate:hibernate-spatial:6.6.0.Final") | ||
|
||
implementation("org.quartz-scheduler:quartz") | ||
|
||
implementation("org.apache.httpcomponents.client5:httpclient5") | ||
|
||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor") | ||
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions") | ||
|
||
implementation("com.fasterxml.jackson.core:jackson-databind") | ||
implementation("com.fasterxml.jackson.core:jackson-core") | ||
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
implementation("com.fasterxml.jackson.module:jackson-module-parameter-names") | ||
|
||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
} | ||
|
||
kotlin { | ||
compilerOptions { | ||
freeCompilerArgs.addAll("-Xjsr305=strict") | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
val imageName = project.hasProperty("imageName").let { | ||
if (it) { | ||
project.property("imageName") as String | ||
} else { | ||
"app:local" | ||
} | ||
} | ||
val releaseVersion = project.hasProperty("releaseVersion").let { | ||
if (it) { | ||
project.property("releaseVersion") as String | ||
} else { | ||
Random().nextInt(90000) + 10000 | ||
} | ||
} | ||
|
||
tasks.register("buildDockerImage") { | ||
dependsOn("bootJar") | ||
|
||
doLast { | ||
exec { | ||
workingDir(".") | ||
commandLine( | ||
"docker", | ||
"build", | ||
"-t", | ||
imageName, | ||
"--build-arg", | ||
"RELEASE_VERSION=$releaseVersion", | ||
'.' | ||
) | ||
} | ||
} | ||
} |
Binary file not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.