chore: add docker canary image version display

This commit is contained in:
moonrailgun 2024-05-05 01:07:35 +08:00
parent 4761c2dd20
commit dc4d88fc47
5 changed files with 10 additions and 4 deletions

View File

@ -51,3 +51,4 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=canary-${{ steps.meta.outputs.tags }}

View File

@ -17,10 +17,15 @@ RUN apk add --update --no-cache python3 py3-pip g++ make
FROM base AS static
WORKDIR /app/tianji
# use with --build-arg VERSION=xxxx
ARG VERSION
COPY . .
RUN pnpm install --frozen-lockfile
ENV VITE_VERSION=$VERSION
RUN pnpm build:static
# Tianji server ------------------------------

View File

@ -7,12 +7,11 @@ import { Button, Divider, Drawer, Dropdown } from 'antd';
import { useUserStore } from '../store/user';
import { useLogout } from '../api/model/user';
import { ColorSchemeSwitcher } from '../components/ColorSchemeSwitcher';
import { version } from '@tianji/shared';
import { version } from '@/utils/env';
import { useIsMobile } from '../hooks/useIsMobile';
import { RiMenuUnfoldLine } from 'react-icons/ri';
import { useTranslation } from '@i18next-toolkit/react';
import { LanguageSelector } from '../components/LanguageSelector';
import { useGlobalConfig } from '../hooks/useConfig';
export const Layout: React.FC = React.memo(() => {
const [params] = useSearchParams();

View File

@ -20,7 +20,7 @@ import { useCurrentWorkspaceId, useUserInfo, useUserStore } from '@/store/user';
import { languages } from '@/utils/constants';
import { useTranslation, setLanguage } from '@i18next-toolkit/react';
import { useNavigate } from '@tanstack/react-router';
import { version } from '@tianji/shared';
import { version } from '@/utils/env';
import React from 'react';
import { LuMoreVertical } from 'react-icons/lu';

View File

@ -1,5 +1,6 @@
import { version } from '@tianji/shared';
import { version as packageJsonVersion } from '@tianji/shared';
export const isDev = import.meta.env.MODE === 'development';
export const version = import.meta.env.VITE_VERSION || packageJsonVersion;
export const anonymousTelemetryUrl = `https://tianji.moonrailgun.com/telemetry/clnzoxcy10001vy2ohi4obbi0/cltg3op5n007lrw4gvr3p8syj.gif?name=tianji-oss&url=${window.location.origin}&v=${version}`;