mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Add version tag system, for matching if the deployment is the newest one
or not.
This commit is contained in:
parent
61de16e285
commit
dd39bc3910
5 changed files with 25 additions and 4 deletions
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN bun run generateVersionTag
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
|
import getVersionTag from "~/versionTag";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
const user = ref("");
|
const user = ref("");
|
||||||
|
@ -294,7 +295,7 @@ const submitChangeAction = async (action: string) => {
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="justiy-center align-center text-center">
|
<div class="justiy-center align-center text-center">
|
||||||
{{ t("app.settings") }} v0.0.3
|
{{ t("app.settings") }} v0.0.3 || Version: {{ getVersionTag() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
"docs:dev": "vitepress dev docs",
|
"docs:dev": "vitepress dev docs",
|
||||||
"docs:build": "vitepress build docs",
|
"docs:build": "vitepress build docs",
|
||||||
"docs:preview": "vitepress preview docs",
|
"docs:preview": "vitepress preview docs",
|
||||||
"wipedev": "./clean-dev-env.sh"
|
"wipedev": "./clean-dev-env.sh",
|
||||||
|
"generateVersionTag": "bun run versionTagGenerate.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource-variable/noto-sans-tc": "^5.2.5",
|
"@fontsource-variable/noto-sans-tc": "^5.2.5",
|
||||||
|
|
3
versionTag.ts
Normal file
3
versionTag.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export default function versionTag() {
|
||||||
|
return "value";
|
||||||
|
}
|
16
versionTagGenerate.ts
Normal file
16
versionTagGenerate.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { $ } from "bun";
|
||||||
|
const characters =
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
function generateVersionTag() {
|
||||||
|
let slug = "";
|
||||||
|
let length = 8;
|
||||||
|
for (let times = 0; times < length; times++) {
|
||||||
|
slug += characters.charAt(Math.floor(Math.random() * characters.length));
|
||||||
|
}
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
const tag = generateVersionTag();
|
||||||
|
// Command
|
||||||
|
await $`echo 'export default function versionTag() {return "${tag}";}' > ./versionTag.ts`;
|
||||||
|
|
||||||
|
console.log("Version Tag:", tag);
|
Loading…
Add table
Add a link
Reference in a new issue