-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjib.gradle
35 lines (33 loc) · 977 Bytes
/
jib.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ext.imagePath = {
def registry_host = System.getenv('REGISTRY_HOST')
def registry_path = System.getenv('REGISTRY_PATH')
def image_name = System.getenv('IMAGE_NAME')
return [registry_host,registry_path,image_name].join('/')
}
ext.imageTag = {
return System.getenv('IMAGE_TAG')
}
jib {
from {
image = 'eclipse-temurin:17.0.6_10-jre-alpine'
auth {
username "$registryUser"
password "$registryPassword"
}
}
to {
image = "${imagePath()}:${imageTag()}"
auth {
username "$registryUser"
password "$registryPassword"
}
}
container {
user = 'www-data'
jvmFlags = ['-Xms512m','-Xmx1024m']
ports = ['8080']
environment = [TZ: "Europe/Moscow",LANG: "en_US.UTF-8"]
creationTime = "USE_CURRENT_TIMESTAMP"
}
new File(projectDir, "deploy.env").text = "image_path=${imagePath()}\nimage_tag=${imageTag()}\n"
}