feat: add build id from commit hash (#1095)
* fix old ref * capture git commit as build ID * generate new types * display build on Site Settings page * fix extras crash it extras is none
This commit is contained in:
parent
7f102f513d
commit
ffb3b45ac2
11 changed files with 21 additions and 16 deletions
1
.github/workflows/backend-docker-nightly.yml
vendored
1
.github/workflows/backend-docker-nightly.yml
vendored
|
@ -47,6 +47,7 @@ jobs:
|
||||||
docker build --push --no-cache \
|
docker build --push --no-cache \
|
||||||
--tag hkotel/mealie:api-nightly \
|
--tag hkotel/mealie:api-nightly \
|
||||||
--platform linux/amd64,linux/arm64 .
|
--platform linux/amd64,linux/arm64 .
|
||||||
|
--build-arg COMMIT=$(git rev-parse HEAD) \
|
||||||
#
|
#
|
||||||
# Build Discord Notification
|
# Build Discord Notification
|
||||||
#
|
#
|
||||||
|
|
|
@ -91,6 +91,9 @@ FROM python-base as production
|
||||||
ENV PRODUCTION=true
|
ENV PRODUCTION=true
|
||||||
ENV TESTING=false
|
ENV TESTING=false
|
||||||
|
|
||||||
|
ARG COMMIT
|
||||||
|
ENV GIT_COMMIT_HASH=$COMMIT
|
||||||
|
|
||||||
# curl for used by healthcheck
|
# curl for used by healthcheck
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install --no-install-recommends -y \
|
&& apt-get install --no-install-recommends -y \
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { BaseAPI } from "../_base";
|
import { BaseAPI } from "../_base";
|
||||||
|
import { AdminAboutInfo } from "~/types/api-types/admin";
|
||||||
|
|
||||||
const prefix = "/api";
|
const prefix = "/api";
|
||||||
|
|
||||||
|
@ -8,17 +9,6 @@ const routes = {
|
||||||
check: `${prefix}/admin/about/check`,
|
check: `${prefix}/admin/about/check`,
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface AdminAboutInfo {
|
|
||||||
production: boolean;
|
|
||||||
version: string;
|
|
||||||
demoStatus: boolean;
|
|
||||||
apiPort: number;
|
|
||||||
apiDocs: boolean;
|
|
||||||
dbType: string;
|
|
||||||
dbUrl: string;
|
|
||||||
defaultGroup: string;
|
|
||||||
versionLatest: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AdminStatistics {
|
export interface AdminStatistics {
|
||||||
totalRecipes: number;
|
totalRecipes: number;
|
||||||
|
|
|
@ -238,6 +238,11 @@ export default defineComponent({
|
||||||
icon: $globals.icons.information,
|
icon: $globals.icons.information,
|
||||||
value: data.version,
|
value: data.version,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Build",
|
||||||
|
icon: $globals.icons.information,
|
||||||
|
value: data.buildId,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: i18n.t("about.application-mode"),
|
name: i18n.t("about.application-mode"),
|
||||||
icon: $globals.icons.devTo,
|
icon: $globals.icons.devTo,
|
||||||
|
|
|
@ -16,6 +16,7 @@ export interface AdminAboutInfo {
|
||||||
dbType: string;
|
dbType: string;
|
||||||
dbUrl?: string;
|
dbUrl?: string;
|
||||||
defaultGroup: string;
|
defaultGroup: string;
|
||||||
|
buildId: string;
|
||||||
}
|
}
|
||||||
export interface AllBackups {
|
export interface AllBackups {
|
||||||
imports: BackupFile[];
|
imports: BackupFile[];
|
||||||
|
|
4
frontend/types/components.d.ts
vendored
4
frontend/types/components.d.ts
vendored
|
@ -13,9 +13,9 @@
|
||||||
import InputLabelType from "@/components/global/InputLabelType.vue";
|
import InputLabelType from "@/components/global/InputLabelType.vue";
|
||||||
import BaseStatCard from "@/components/global/BaseStatCard.vue";
|
import BaseStatCard from "@/components/global/BaseStatCard.vue";
|
||||||
import DevDumpJson from "@/components/global/DevDumpJson.vue";
|
import DevDumpJson from "@/components/global/DevDumpJson.vue";
|
||||||
|
import LanguageDialog from "@/components/global/LanguageDialog.vue";
|
||||||
import InputQuantity from "@/components/global/InputQuantity.vue";
|
import InputQuantity from "@/components/global/InputQuantity.vue";
|
||||||
import ToggleState from "@/components/global/ToggleState.vue";
|
import ToggleState from "@/components/global/ToggleState.vue";
|
||||||
import LanguageDialog from "~/components/global/LanguageDialog.vue";
|
|
||||||
import AppButtonCopy from "@/components/global/AppButtonCopy.vue";
|
import AppButtonCopy from "@/components/global/AppButtonCopy.vue";
|
||||||
import CrudTable from "@/components/global/CrudTable.vue";
|
import CrudTable from "@/components/global/CrudTable.vue";
|
||||||
import InputColor from "@/components/global/InputColor.vue";
|
import InputColor from "@/components/global/InputColor.vue";
|
||||||
|
@ -48,9 +48,9 @@ declare module "vue" {
|
||||||
InputLabelType: typeof InputLabelType;
|
InputLabelType: typeof InputLabelType;
|
||||||
BaseStatCard: typeof BaseStatCard;
|
BaseStatCard: typeof BaseStatCard;
|
||||||
DevDumpJson: typeof DevDumpJson;
|
DevDumpJson: typeof DevDumpJson;
|
||||||
|
LanguageDialog: typeof LanguageDialog;
|
||||||
InputQuantity: typeof InputQuantity;
|
InputQuantity: typeof InputQuantity;
|
||||||
ToggleState: typeof ToggleState;
|
ToggleState: typeof ToggleState;
|
||||||
LanguageDialog: typeof LanguageDialog;
|
|
||||||
AppButtonCopy: typeof AppButtonCopy;
|
AppButtonCopy: typeof AppButtonCopy;
|
||||||
CrudTable: typeof CrudTable;
|
CrudTable: typeof CrudTable;
|
||||||
InputColor: typeof InputColor;
|
InputColor: typeof InputColor;
|
||||||
|
|
3
makefile
3
makefile
|
@ -55,7 +55,8 @@ setup-model: ## 🤖 Get the latest NLP CRF++ Model
|
||||||
@echo Fetching NLP Model - CRF++ is still Required
|
@echo Fetching NLP Model - CRF++ is still Required
|
||||||
curl -L0 https://github.com/mealie-recipes/nlp-model/releases/download/v1.0.0/model.crfmodel --output ./mealie/services/parser_services/crfpp/model.crfmodel
|
curl -L0 https://github.com/mealie-recipes/nlp-model/releases/download/v1.0.0/model.crfmodel --output ./mealie/services/parser_services/crfpp/model.crfmodel
|
||||||
|
|
||||||
clean-data: clean ## ⚠️ Removes All Developer Data for a fresh server start
|
|
||||||
|
clean-data: ## ⚠️ Removes All Developer Data for a fresh server start
|
||||||
rm -r ./dev/data/recipes/
|
rm -r ./dev/data/recipes/
|
||||||
rm -r ./dev/data/users/
|
rm -r ./dev/data/users/
|
||||||
rm -f ./dev/data/mealie*.db
|
rm -f ./dev/data/mealie*.db
|
||||||
|
|
|
@ -32,6 +32,8 @@ class AppSettings(BaseSettings):
|
||||||
TOKEN_TIME: int = 48 # Time in Hours
|
TOKEN_TIME: int = 48 # Time in Hours
|
||||||
SECRET: str
|
SECRET: str
|
||||||
|
|
||||||
|
GIT_COMMIT_HASH: str = "unknown"
|
||||||
|
|
||||||
ALLOW_SIGNUP: bool = True
|
ALLOW_SIGNUP: bool = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -31,7 +31,7 @@ def recipe_extras(func):
|
||||||
|
|
||||||
if extras is None:
|
if extras is None:
|
||||||
extras = []
|
extras = []
|
||||||
|
else:
|
||||||
extras = [{"key": key, "value": value} for key, value in extras.items()]
|
extras = [{"key": key, "value": value} for key, value in extras.items()]
|
||||||
|
|
||||||
return func(*args, extras=extras, **kwargs)
|
return func(*args, extras=extras, **kwargs)
|
||||||
|
|
|
@ -26,6 +26,7 @@ class AdminAboutController(BaseAdminController):
|
||||||
db_url=settings.DB_URL_PUBLIC,
|
db_url=settings.DB_URL_PUBLIC,
|
||||||
default_group=settings.DEFAULT_GROUP,
|
default_group=settings.DEFAULT_GROUP,
|
||||||
allow_signup=settings.ALLOW_SIGNUP,
|
allow_signup=settings.ALLOW_SIGNUP,
|
||||||
|
build_id=settings.GIT_COMMIT_HASH,
|
||||||
)
|
)
|
||||||
|
|
||||||
@router.get("/statistics", response_model=AppStatistics)
|
@router.get("/statistics", response_model=AppStatistics)
|
||||||
|
|
|
@ -23,6 +23,7 @@ class AdminAboutInfo(AppInfo):
|
||||||
db_type: str
|
db_type: str
|
||||||
db_url: str | None
|
db_url: str | None
|
||||||
default_group: str
|
default_group: str
|
||||||
|
build_id: str
|
||||||
|
|
||||||
|
|
||||||
class CheckAppConfig(CamelModel):
|
class CheckAppConfig(CamelModel):
|
||||||
|
|
Loading…
Reference in a new issue