Compare commits
2 Commits
84fbf6debc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
1bc3057819
|
|||
|
5efe14c78a
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: Push to dokku
|
||||
uses: dokku/github-action@master
|
||||
with:
|
||||
git_remote_url: 'ssh://dokku@heroku.ctdn.net:2222/spring-web-modules'
|
||||
git_remote_url: 'ssh://dokku@heroku.ctdn.net:2222/spring-web-api-demo'
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
branch: main
|
||||
git_push_flags: --force
|
||||
|
||||
@@ -4,8 +4,6 @@ LABEL maintainer="sombochea@cubetiqs.com"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update && apk add git
|
||||
|
||||
COPY gradlew ./
|
||||
COPY gradle ./gradle
|
||||
RUN ./gradlew
|
||||
@@ -15,7 +13,6 @@ COPY settings.gradle.kts ./
|
||||
COPY build.gradle.kts ./
|
||||
COPY api/build.gradle.kts ./api/build.gradle.kts
|
||||
COPY api/src ./api/src
|
||||
COPY .git ./.git
|
||||
|
||||
RUN ./gradlew api:bootJar
|
||||
|
||||
|
||||
@@ -1,66 +1,46 @@
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot")
|
||||
id("io.spring.dependency-management")
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.spring")
|
||||
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()
|
||||
id("org.springframework.boot")
|
||||
id("io.spring.dependency-management")
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.spring")
|
||||
kotlin("plugin.jpa")
|
||||
}
|
||||
|
||||
springBoot {
|
||||
buildInfo {
|
||||
properties {
|
||||
this.additional.put("commitId", getGitHashLastCommit())
|
||||
this.additional.put("springBootVersion", springBootVersion)
|
||||
this.additional.put("kotlinVersion", kotlinVersion)
|
||||
}
|
||||
}
|
||||
buildInfo { }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Spring Data JPA (Required for Database Layer)
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
// Spring Data JPA (Required for Database Layer)
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
|
||||
// Migrating from SpringDoc API (Swagger) for Support Spring Boot 3.x
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2")
|
||||
// Migrating from SpringDoc API (Swagger) for Support Spring Boot 3.x
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2")
|
||||
|
||||
// SPRING FRAMEWORK AND CORE
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
// SPRING FRAMEWORK AND CORE
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
|
||||
// Development Runtime
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
// Development Runtime
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
|
||||
runtimeOnly("com.h2database:h2")
|
||||
// runtimeOnly("org.postgresql:postgresql")
|
||||
runtimeOnly("com.h2database:h2")
|
||||
// runtimeOnly("org.postgresql:postgresql")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
|
||||
archiveFileName.set("api.jar")
|
||||
archiveFileName.set("api.jar")
|
||||
}
|
||||
@@ -33,7 +33,6 @@ class IndexController @Autowired constructor(
|
||||
service = buildProperties.artifact,
|
||||
version = buildProperties.version,
|
||||
date = buildProperties.time.toString(),
|
||||
commit = buildProperties["commitId"],
|
||||
authors = authors,
|
||||
)
|
||||
return response(response)
|
||||
|
||||
@@ -9,7 +9,6 @@ data class ApiInfoResponse(
|
||||
val service: String,
|
||||
val version: String,
|
||||
val date: String,
|
||||
val commit: String,
|
||||
val authors: Collection<ApiInfoAuthorResponse> = listOf(),
|
||||
) : BaseRequestModel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user