65 lines
2.1 KiB
Markdown
65 lines
2.1 KiB
Markdown
# Deploy Web — pflores.linkedcorp.net
|
|
|
|
## Checklist previo a cualquier push
|
|
|
|
- [ ] `git status` — sin `.env` ni `.token_gitea` en staging
|
|
- [ ] Site local responde: `curl -s http://127.0.0.1:8081/ | grep -c "Patricia Soledad"` ≥ 1
|
|
- [ ] PDF local funciona: `curl -sI http://127.0.0.1:8081/?cv_pdf=1 | grep Content-Type`
|
|
- [ ] Si hubo cambios funcionales: actualizar `VERSION` y `CHANGELOG.md`
|
|
|
|
## Pasos — ciclo normal de deploy
|
|
|
|
```bash
|
|
# 1. En desarrollo — agregar y commitear
|
|
git add frontend/ backend/wordpress/wp-content/plugins/pflores-cv-fields/
|
|
git add backend/wordpress/wp-content/themes/apex-cv/
|
|
git add backend/wordpress/wp-config.php README.md CHANGELOG.md VERSION PROMPT_IA.md
|
|
git status | grep -E "\.env|token_gitea|LOCAL_DEPLOY" # debe retornar vacío
|
|
git commit -m "tipo: descripción"
|
|
|
|
# 2. Push a Gitea
|
|
TOKEN="ae4c49a577402354b88c14870821de85a9622019"
|
|
git push "https://mgonzalez:${TOKEN}@gitea.linkedcorp.net/mgonzalez/pflores.linkedcorp.net.git" main
|
|
|
|
# 3. Entrar al servidor de producción
|
|
ssh deploy@192.168.222.3 -p 2203
|
|
|
|
# 4. Ejecutar el script de deploy
|
|
cd /opt/apps/pflores.linkedcorp.net
|
|
bash scripts/deploy_prod_web.sh
|
|
|
|
# 5. Verificar
|
|
curl -s -o /dev/null -w "HTTP %{http_code}" http://127.0.0.1:8081/
|
|
curl -sI http://127.0.0.1:8081/?cv_pdf=1 | grep Content-Type
|
|
```
|
|
|
|
## Script de deploy (`scripts/deploy_prod_web.sh`)
|
|
|
|
El script hace automáticamente:
|
|
1. `git fetch + git reset --hard` — actualiza el código
|
|
2. Verifica que los plugins de terceros estén instalados
|
|
3. `sudo systemctl restart pflores-web`
|
|
4. Verifica HTTP 200
|
|
|
|
## No tocar durante el deploy
|
|
|
|
- `/opt/apps/pflores.linkedcorp.net/.env` — credenciales de producción
|
|
- Base de datos de producción (`.32`)
|
|
- Plugins de terceros (`cmb2/`, `wp-mail-smtp/`) si ya están instalados
|
|
|
|
## Servidor de producción
|
|
|
|
- SSH: `deploy@192.168.222.3 -p 2203`
|
|
- Credenciales: `.token_gitea` bloque `# Produccion user`
|
|
- Servicio: `pflores-web.service` (systemd)
|
|
- Puerto interno: `127.0.0.1:8081`
|
|
- NPM apunta a: `192.168.222.3:8081`
|
|
|
|
## Comandos útiles en producción
|
|
|
|
```bash
|
|
sudo systemctl status pflores-web
|
|
sudo systemctl restart pflores-web
|
|
sudo journalctl -u pflores-web -n 50 --no-pager
|
|
```
|