Skip to content

Commit

Permalink
✨feature : JIB, GitAction 설정 (CI설정)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkYunHo committed Jun 20, 2023
1 parent 8901b1f commit 5e7d04b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
33 changes: 33 additions & 0 deletions auth/build.gradle.kts
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 {
Expand All @@ -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 <qkrdbsgh0921@gmail.com>"
)
)
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
)
}
}
5 changes: 2 additions & 3 deletions auth/src/main/resources/application-auth.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

server:
port: 9000
spring:
Expand Down Expand Up @@ -53,8 +52,8 @@ vault:
uri: http://localhost:8200
token:
app-role:
role-id: 9f85afd3-01cc-5e53-17e8-d408addbd711
secret-id: f6b4049b-e191-35df-de8f-484a875854bf
role-id: ff40ec6f-3120-7a01-b114-7a6a34fa497b
secret-id: 4d64cbeb-6c66-7136-7766-701cbd0856d7
secret:
appconfig: oauth2-app/local

Expand Down

0 comments on commit 5e7d04b

Please sign in to comment.