Skip to content

Commit 8b6ec7f

Browse files
committed
fix: Add lifecycle plugin and simplify build process
1 parent eef5aff commit 8b6ec7f

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@ WORKDIR /app
44
COPY . .
55
WORKDIR /app/Location-based-target-authentication
66

7-
# Create a custom build script
8-
COPY <<EOF /app/build.sh
9-
#!/bin/bash
10-
cd /app/Location-based-target-authentication
11-
chmod +x ./gradlew
12-
./gradlew bootJar -x test --build-cache --parallel
13-
EOF
14-
15-
RUN chmod +x /app/build.sh && /app/build.sh
7+
RUN chmod +x ./gradlew
8+
RUN ./gradlew bootJar -x test --build-cache --parallel
169

1710
FROM cloudtype/jre:17
1811
WORKDIR /app

Location-based-target-authentication/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'org.springframework.boot' version '3.2.2'
44
id 'io.spring.dependency-management' version '1.1.7'
55
id 'base'
6+
id 'lifecycle-base'
67
}
78

89
group = 'com.swyp'
@@ -74,9 +75,11 @@ tasks.withType(Jar) {
7475
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
7576
}
7677

77-
clean {
78-
delete layout.buildDirectory
79-
delete fileTree(dir: projectDir) {
80-
include '**/*.class'
78+
tasks.named('clean') {
79+
doLast {
80+
delete layout.buildDirectory
81+
delete fileTree(dir: projectDir) {
82+
include '**/*.class'
83+
}
8184
}
8285
}

0 commit comments

Comments
 (0)