amalia/29-apr-26 #16

Merged
amaliadwiy merged 15 commits from amalia/29-apr-26 into main 2026-04-29 17:40:58 +08:00
17 changed files with 992 additions and 319 deletions
Showing only changes of commit f44a8216bf - Show all commits

View File

@@ -112,23 +112,27 @@ server.tool(
async ({ tag }) => { async ({ tag }) => {
const log: string[] = [] const log: string[] = []
// ── 1. Cek migrasi ────────────────────────────────────────────────────── // ── 1. Cek & jalankan migrasi jika ada ─────────────────────────────────
const migrate = await sh(['bunx', 'prisma', 'migrate', 'status']) const migrateStatus = await sh(['bunx', 'prisma', 'migrate', 'status'])
if (!migrate.ok || migrate.out.includes('not yet been applied')) { if (!migrateStatus.ok || migrateStatus.out.includes('not yet been applied')) {
return { log.push('⏳ Ada pending migrations — menjalankan migrate deploy...')
content: [{ const migrateRun = await sh(['bunx', 'prisma', 'migrate', 'deploy'])
type: 'text', if (!migrateRun.ok) {
text: [ return {
'❌ Deploy dibatalkan — ada pending migrations.', content: [{
'', type: 'text',
migrate.out || migrate.err, text: [
'', ...log,
'Jalankan `bun run db:migrate` terlebih dahulu.', '❌ Migrate deploy gagal:',
].join('\n'), migrateRun.err || migrateRun.out,
}], ].join('\n'),
}],
}
} }
log.push('✅ Migrations: deployed')
} else {
log.push('✅ Migrations: up to date')
} }
log.push('✅ Migrations: up to date')
// ── 2. Version bump ────────────────────────────────────────────────────── // ── 2. Version bump ──────────────────────────────────────────────────────
const pkgPath = `${process.cwd()}/package.json` const pkgPath = `${process.cwd()}/package.json`