-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
65 additions
and
3 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,30 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v**' | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build Gradle with JIB | ||
run: ./gradlew clean \ | ||
--stacktrace \ | ||
-PtagName=$GITHUB_REF_NAME \ | ||
--build-file=./auth/build.gradle.kts \ | ||
-Djib.console=plain \ | ||
-Djib.useOnlyProjectCache=true \ | ||
jib |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
plugins { | ||
id("com.google.cloud.tools.jib") version "3.3.2" | ||
} | ||
|
||
dependencies { | ||
|
@@ -19,4 +20,36 @@ project.delete( | |
|
||
kotlin.sourceSets.main { | ||
kotlin.srcDir("$buildDir/generated/source/kapt/main") | ||
} | ||
|
||
// JIB CI설정 | ||
val tagName = project.properties["tagName"] | ||
val regex = Regex("^v") | ||
|
||
jib { | ||
from { | ||
image = "eclipse-temurin:17" | ||
} | ||
to { | ||
image = "johnpark0921/oauth2-app:$tagName" | ||
// if(regex.containsMatchIn(tagName as String)) { | ||
// tags = setOf("latest") | ||
// } | ||
} | ||
container { | ||
labels.set( | ||
mapOf( | ||
"maintainer" to "yoonho <[email protected]>" | ||
) | ||
) | ||
creationTime.set("USE_CURRENT_TIMESTAMP") | ||
setFormat("OCI") | ||
environment = mapOf( | ||
"TZ" to "Asia/Seoul" | ||
) | ||
jvmFlags = listOf( | ||
"-Dsun.net.inetaddr.ttl=0", // DNS cache TTL | ||
"-XX:+PrintCommandLineFlags", // Print JVM Flags | ||
) | ||
} | ||
} |
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