-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'be/dev/cron' of github.com:innovationacademy-kr/Cabi in…
…to be/dev/cron
- Loading branch information
Showing
23 changed files
with
1,116 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,66 @@ | ||
name: backend CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- "cron/**" | ||
pull_request: | ||
paths: | ||
- "cron/**" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Make ssh file | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo '${{ secrets.SSH_CONFIG }}' | base64 -d > ~/.ssh/id_rsa | ||
chmod 400 ~/.ssh/id_rsa | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodule: true | ||
- name: Update submodule | ||
run: | | ||
git submodule update --init config/ | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "17" | ||
distribution: "corretto" | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build with Gradle | ||
run: | | ||
cd cron | ||
chmod +x gradlew | ||
./gradlew jar | ||
shell: bash | ||
- name: Main S3에 업로드 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
cp cron/build/libs/cron-*.jar deploy-cron/build | ||
mkdir -p deploy && cp deploy-cron/* deploy/ | ||
zip -r deploy.zip deploy | ||
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_MAIN_BUCKET_NAME }}/deploy.zip | ||
aws deploy create-deployment \ | ||
--application-name ${{ secrets.AWS_CODEDEPLOY_MAIN_APP_NAME }} \ | ||
--deployment-config-name CodeDeployDefault.AllAtOnce \ | ||
--deployment-group-name ${{ secrets.AWS_CODEDEPLOY_MAIN_GROUP_NAME }} \ | ||
--file-exists-behavior OVERWRITE \ | ||
--s3-location bucket=${{ secrets.AWS_S3_MAIN_BUCKET_NAME }},bundleType=zip,key=deploy.zip |
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,44 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store | ||
|
||
**/resources/config/** |
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,68 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version '1.9.0' | ||
id 'application' | ||
} | ||
ext { | ||
jacksonVersion = '2.15.2' | ||
okhttpVersion = '2.7.5' | ||
exposedVersion = '0.41.1' | ||
mariadbVersion = "3.1.4" | ||
h2Version = "2.2.220" | ||
} | ||
|
||
group = 'org.example' | ||
version = '1.0-SNAPSHOT' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" | ||
implementation "com.squareup.okhttp:okhttp:${okhttpVersion}" | ||
implementation "org.jetbrains.exposed:exposed-core:${exposedVersion}" | ||
implementation "org.jetbrains.exposed:exposed-dao:${exposedVersion}" | ||
implementation "org.jetbrains.exposed:exposed-jdbc:${exposedVersion}" | ||
implementation "org.jetbrains.exposed:exposed-java-time:${exposedVersion}" | ||
runtimeOnly "org.mariadb.jdbc:mariadb-java-client:${mariadbVersion}" | ||
implementation "com.zaxxer:HikariCP:5.0.1" | ||
implementation "io.github.microutils:kotlin-logging-jvm:2.0.10" | ||
implementation "org.slf4j:slf4j-api:1.7.30" | ||
implementation "org.slf4j:slf4j-simple:1.7.25" | ||
|
||
testImplementation "org.jetbrains.kotlin:kotlin-test" | ||
testRuntimeOnly "com.h2database:h2:${h2Version}" | ||
} | ||
|
||
tasks.register('copyMainConfig', Copy) { | ||
from '../config/cron/src/resources/config' | ||
into 'src/main/resources/config' | ||
} | ||
|
||
tasks.named('processResources') { | ||
dependsOn 'copyMainConfig' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
application { | ||
mainClass.set("MainKt") | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Main-Class': 'MainKt' | ||
} | ||
from { | ||
configurations.runtimeClasspath.collect { | ||
it.isDirectory() ? it : zipTree(it) | ||
} | ||
} | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} |
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 @@ | ||
kotlin.code.style=official |
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.