mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-20 17:15:39 -05:00
automate fresh repo cloning, resolve asset caching, and auto-update Vyla SDK at startup
This commit is contained in:
@@ -20,11 +20,13 @@ const REPO_CONFIG = {
|
||||
};
|
||||
|
||||
function clonePrivateRepo(repoConfig, targetDir) {
|
||||
const repoUrl = `https://gitlab.com/${GITLAB_GROUP}/${repoConfig.name}.git`;
|
||||
const token = process.env.GITLAB_TOKEN || process.env.VYLA_GITLAB_TOKEN;
|
||||
const auth = token ? `oauth2:${token}@` : '';
|
||||
const repoUrl = `https://${auth}gitlab.com/${GITLAB_GROUP}/${repoConfig.name}.git`;
|
||||
|
||||
try {
|
||||
if (fs.existsSync(targetDir)) {
|
||||
fs.rmSync(targetDir, { recursive: true, force: true });
|
||||
fs.rmSync(targetDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
||||
}
|
||||
|
||||
execSync(`git clone --depth 1 --branch ${repoConfig.branch} ${repoUrl} ${targetDir}`, {
|
||||
@@ -332,6 +334,9 @@ async function build() {
|
||||
}
|
||||
|
||||
const zipPath = path.join(__dirname, 'update-payload.zip');
|
||||
if (fs.existsSync(zipPath)) {
|
||||
fs.rmSync(zipPath, { force: true });
|
||||
}
|
||||
zip.writeZip(zipPath);
|
||||
|
||||
const checksum = validatePayload(zipPath);
|
||||
|
||||
Reference in New Issue
Block a user