feat: Introduce application version display in the frontend footer, showing both frontend and backend versions with integrated build arguments.
All checks were successful
Release and Build Docker Images / release-and-build (push) Successful in 1m29s
All checks were successful
Release and Build Docker Images / release-and-build (push) Successful in 1m29s
This commit is contained in:
@@ -8,6 +8,8 @@ RUN mvn clean package -DskipTests
|
||||
# Run stage
|
||||
FROM eclipse-temurin:25-jre
|
||||
WORKDIR /app
|
||||
ARG APP_VERSION=dev
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
COPY --from=build /app/target/*.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.todo.backend.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/version")
|
||||
public class VersionController {
|
||||
|
||||
@Value("${APP_VERSION:dev}")
|
||||
private String appVersion;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Map<String, String>> getVersion() {
|
||||
Map<String, String> response = new HashMap<>();
|
||||
response.put("version", appVersion);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user