@@ -42,33 +42,28 @@ tasks.wrapper {
42
42
tasks.register(" buildImage" , type = Exec ::class ) {
43
43
dependsOn(" jpackage" )
44
44
commandLine(" docker" , " compose" , " --profile" , " local" , " build" )
45
-
46
- environment(
47
- " REGISTRY" to (environment[" REGISTRY" ] ? : " k3d.localhost:5000/" ),
48
- " VERSION" to version
49
- )
45
+ dockerEnvironment()
50
46
}
51
47
52
48
tasks.register(" push" , type = Exec ::class ) {
53
49
dependsOn(" buildImage" )
54
50
commandLine(" docker" , " compose" , " --profile" , " local" , " push" )
55
-
56
- environment(
57
- " REGISTRY" to (environment[" REGISTRY" ] ? : " k3d.localhost:5000/" ),
58
- " VERSION" to version
59
- )
51
+ dockerEnvironment()
60
52
}
61
53
62
54
tasks.register(" up" , type = Exec ::class ) {
63
55
dependsOn(" push" )
64
56
commandLine(" docker" , " compose" , " --profile" , " local" , " up" , " -d" )
57
+ dockerEnvironment()
58
+ }
59
+
60
+ tasks.register(" rm" , type = Exec ::class ) {
61
+ commandLine(" docker" , " compose" , " --profile" , " local" , " rm" , " -sfv" )
62
+ }
65
63
64
+ fun Exec.dockerEnvironment () {
66
65
environment(
67
66
" REGISTRY" to (environment[" REGISTRY" ] ? : " k3d.localhost:5000/" ),
68
67
" VERSION" to version
69
68
)
70
69
}
71
-
72
- tasks.register(" rm" , type = Exec ::class ) {
73
- commandLine(" docker" , " compose" , " --profile" , " local" , " rm" , " -sfv" )
74
- }
0 commit comments