# Step 7 Commands Cheatsheet

## Generate deploy path cPanel

Staging:

```bash
php scripts/generate_cpanel_yml.php staging itcd5572 public_html/staging-perawat
```

Production:

```bash
php scripts/generate_cpanel_yml.php production itcd5572 public_html/perawat
```

Sesuaikan `itcd5572` dan path jika berbeda di cPanel.

## Buat .env

```bash
php scripts/create_env.php staging
php scripts/create_env.php production
```

## Cek server

```bash
php scripts/post_deploy.php
php scripts/preflight.php
php scripts/deploy_ready.php staging
php scripts/healthcheck.php
php scripts/step7_smoke_test.php
```

## Database

```bash
php scripts/migrate.php status
php scripts/migrate.php up
```

Untuk SQL lama yang sudah pernah dijalankan:

```bash
php scripts/migrate.php mark-all --legacy
```

## Backup

```bash
php scripts/backup_files.php
php scripts/backup_database.php
```

## Git

```bash
bash scripts/init_git_branches.sh git@github.com:OWNER/REPO.git
git push -u origin main
git push -u origin develop
```
