chore: use timestamp as default image tag (YYYY-MM-DD-HH)

This commit is contained in:
ZhenYi 2026-04-15 10:16:13 +08:00
parent 852dec099d
commit fd724ca4ae
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ const { execSync } = require('child_process');
const path = require('path');
const REGISTRY = process.env.REGISTRY || 'harbor.gitdata.me/gta_team';
const TAG = process.env.TAG || 'latest';
const TAG = process.env.TAG || new Date().toISOString().slice(0, 13).replace('T', '-');
const BUILD_TARGET = process.env.TARGET || 'x86_64-unknown-linux-gnu';
const RUST_SERVICES = ['app', 'gitserver', 'email-worker', 'git-hook', 'operator', 'static'];

View File

@ -16,7 +16,7 @@
const { execSync } = require('child_process');
const REGISTRY = process.env.REGISTRY || 'harbor.gitdata.me/gta_team';
const TAG = process.env.TAG || process.env.GITHUB_SHA?.substring(0, 8) || 'latest';
const TAG = process.env.TAG || new Date().toISOString().slice(0, 13).replace('T', '-');
const DOCKER_USER = process.env.DOCKER_USER || process.env.HARBOR_USERNAME;
const DOCKER_PASS = process.env.DOCKER_PASS || process.env.HARBOR_PASSWORD;
@ -58,7 +58,7 @@ for (const service of targets) {
console.log(`\n==> Pushing ${image}`);
try {
execSync(`docker push "${image}" --all-tags`, { stdio: 'inherit' });
execSync(`docker push "${image}"`, { stdio: 'inherit' });
console.log(` [OK] ${image}`);
} catch (error) {
console.error(` [FAIL] ${service}`);