Fixed and remove git source from build
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
84fbf6debc
commit
5efe14c78a
@ -4,8 +4,6 @@ LABEL maintainer="sombochea@cubetiqs.com"
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk update && apk add git
|
|
||||||
|
|
||||||
COPY gradlew ./
|
COPY gradlew ./
|
||||||
COPY gradle ./gradle
|
COPY gradle ./gradle
|
||||||
RUN ./gradlew
|
RUN ./gradlew
|
||||||
@ -15,7 +13,6 @@ COPY settings.gradle.kts ./
|
|||||||
COPY build.gradle.kts ./
|
COPY build.gradle.kts ./
|
||||||
COPY api/build.gradle.kts ./api/build.gradle.kts
|
COPY api/build.gradle.kts ./api/build.gradle.kts
|
||||||
COPY api/src ./api/src
|
COPY api/src ./api/src
|
||||||
COPY .git ./.git
|
|
||||||
|
|
||||||
RUN ./gradlew api:bootJar
|
RUN ./gradlew api:bootJar
|
||||||
|
|
||||||
|
@ -8,28 +8,8 @@ plugins {
|
|||||||
kotlin("plugin.jpa")
|
kotlin("plugin.jpa")
|
||||||
}
|
}
|
||||||
|
|
||||||
val kotlinVersion = "1.8.10"
|
|
||||||
val springBootVersion = "3.0.4"
|
|
||||||
|
|
||||||
// find the last commit
|
|
||||||
fun getGitHashLastCommit(): String {
|
|
||||||
val stdout = ByteArrayOutputStream()
|
|
||||||
exec {
|
|
||||||
commandLine("git", "rev-parse", "HEAD")
|
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
|
|
||||||
return stdout.toString().trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
springBoot {
|
springBoot {
|
||||||
buildInfo {
|
buildInfo { }
|
||||||
properties {
|
|
||||||
this.additional.put("commitId", getGitHashLastCommit())
|
|
||||||
this.additional.put("springBootVersion", springBootVersion)
|
|
||||||
this.additional.put("kotlinVersion", kotlinVersion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -33,7 +33,6 @@ class IndexController @Autowired constructor(
|
|||||||
service = buildProperties.artifact,
|
service = buildProperties.artifact,
|
||||||
version = buildProperties.version,
|
version = buildProperties.version,
|
||||||
date = buildProperties.time.toString(),
|
date = buildProperties.time.toString(),
|
||||||
commit = buildProperties["commitId"],
|
|
||||||
authors = authors,
|
authors = authors,
|
||||||
)
|
)
|
||||||
return response(response)
|
return response(response)
|
||||||
|
@ -9,7 +9,6 @@ data class ApiInfoResponse(
|
|||||||
val service: String,
|
val service: String,
|
||||||
val version: String,
|
val version: String,
|
||||||
val date: String,
|
val date: String,
|
||||||
val commit: String,
|
|
||||||
val authors: Collection<ApiInfoAuthorResponse> = listOf(),
|
val authors: Collection<ApiInfoAuthorResponse> = listOf(),
|
||||||
) : BaseRequestModel
|
) : BaseRequestModel
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user