d3ro-voice/scripts/ci/push-to-chanpaca-git.mjs
Yun Chan 708e20f747
Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
feat: complete release preparation, 10+ ad mediation, CI/CD, and docker deployment
2026-08-20 11:12:05 +09:00

56 lines
2.1 KiB
JavaScript

// scripts/ci/push-to-chanpaca-git.mjs
// Pushes the monorepo to the user's git.chanpaca.net remote repository
import { spawnSync } from 'node:child_process';
import { readFileSync, existsSync } from 'node:fs';
let user = 'yunchan';
let pass = 'ONVI2v4J#y';
let repo = 'd3ro-voice';
if (existsSync('.env')) {
const envContent = readFileSync('.env', 'utf8');
for (const line of envContent.split('\n')) {
const trimmed = line.trim();
if (trimmed.startsWith('GIT_USERNAME=')) user = trimmed.split('=')[1].trim();
if (trimmed.startsWith('GIT_PASSWORD=')) pass = trimmed.split('=')[1].trim();
if (trimmed.startsWith('GIT_REPO_NAME=')) repo = trimmed.split('=')[1].trim();
}
}
const encodedPass = encodeURIComponent(pass);
const remoteUrl = `https://${user}:${encodedPass}@git.chanpaca.net/${user}/${repo}.git`;
function run(cmd, args) {
console.log(`▶ Running: ${cmd} ${args.join(' ')}`);
const res = spawnSync(cmd, args, { stdio: 'inherit', shell: process.platform === 'win32' });
if (res.status !== 0) {
console.error(`Command failed with status ${res.status}`);
}
return res.status === 0;
}
console.log('--- Configuring Git Remote for git.chanpaca.net ---');
// Check if chanpaca remote exists
const remoteCheck = spawnSync('git', ['remote', 'get-url', 'chanpaca'], { encoding: 'utf8' });
if (remoteCheck.status === 0) {
run('git', ['remote', 'set-url', 'chanpaca', remoteUrl]);
} else {
run('git', ['remote', 'add', 'chanpaca', remoteUrl]);
}
console.log('\n--- Staging and committing all changes ---');
run('git', ['add', '-A']);
run('git', ['commit', '-m', 'feat: add 10+ ad networks mediation, full CI/CD workflows, admin CRM, and production packaging']);
console.log('\n--- Pushing to git.chanpaca.net (main & tags) ---');
const pushMain = run('git', ['push', '-u', 'chanpaca', 'HEAD:main', '--force']);
const pushTags = run('git', ['push', 'chanpaca', '--tags']);
if (pushMain) {
console.log('\n🎉 Successfully pushed full codebase to https://git.chanpaca.net/' + user + '/' + repo);
} else {
console.error('\n❌ Push to git.chanpaca.net failed.');
process.exit(1);
}