Skip to content

Commit

Permalink
added tiltfile, k8s files
Browse files Browse the repository at this point in the history
  • Loading branch information
shadabshamsi committed Apr 17, 2024
1 parent ca14a6d commit 6bf829e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
35 changes: 35 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# OS Identification
gradlew = "./gradlew"
expected_ref = "$EXPECTED_REF"
if os.name == "nt":
gradlew = "gradlew.bat"
expected_ref = "%EXPECTED_REF%"

# Build
custom_build(
# Name of the container image
ref = 'config-service',
# Command to build the container image
command = gradlew + ' bootBuildImage --imageName ' + expected_ref,
# Files to watch that trigger a new build
# deps = ['build.gradle', 'build/classes', 'src/main/resources'],
deps = ['build.gradle', 'src'],

# live_update = [
# sync('build/classes/java/main', '/workspace/BOOT-INF/classes'),
# sync('src/main/resources', '/workspace/BOOT-INF/classes')
# ]
)

# local_resource(
# 'compile-java',
# gradlew + ' compileJava',
# deps=['src', 'build.gradle'])

# Deploy
k8s_yaml(['k8s/deployment.yml', 'k8s/service.yml'])

k8s_resource(
workload='config-service',
port_forwards=8888
)
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ext {

dependencies {
implementation 'org.springframework.cloud:spring-cloud-config-server'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

Expand All @@ -36,12 +37,14 @@ tasks.named('test') {

tasks.named("bootBuildImage") {
builder = "dashaun/builder:tiny"
buildpacks = ["urn:cnb:builder:paketo-buildpacks/java", "gcr.io/paketo-buildpacks/health-checker:latest"]
}

bootBuildImage {
imageName = "${project.name}"
environment = ["BP_JVM_VERSION" : "17.*", "BP_NATIVE_IMAGE" : "false" // native image not working well on mac
// , BP_LIVE_RELOAD_ENABLED : "true" // when enabled, native image won't be build
, "BP_HEALTH_CHECKER_ENABLED" : "true"
]

docker {
Expand Down
2 changes: 1 addition & 1 deletion k8s/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
memory: "1280Mi"
cpu: "500m"
ports:
- containerPort: 9001
- containerPort: 8888
env:
- name: BPL_JVM_THREAD_COUNT
value: "50"
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ spring:
clone-on-start: true
force-pull: true
# basedir:


management:
endpoints:
web:
exposure:
include: health

0 comments on commit 6bf829e

Please sign in to comment.