Skip to content

Commit

Permalink
chore: add docker canary image version display
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed May 4, 2024
1 parent 4761c2d commit dc4d88f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish-canary.yml
Expand Up @@ -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 }}
5 changes: 5 additions & 0 deletions Dockerfile
Expand Up @@ -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 ------------------------------
Expand Down
3 changes: 1 addition & 2 deletions src/client/pages/Layout.tsx
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/Layout/UserConfig.tsx
Expand Up @@ -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';

Expand Down
3 changes: 2 additions & 1 deletion src/client/utils/env.ts
@@ -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}`;

0 comments on commit dc4d88f

Please sign in to comment.