Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
428ad83e5b | ||
|
|
80862bef5b | ||
|
|
777e47ce16 | ||
|
|
167ae4057a | ||
|
|
51300c234a | ||
|
|
0c0efe3727 | ||
|
|
e4dafe9017 | ||
|
|
fed5dfc1c1 | ||
|
|
5773154db9 | ||
|
|
553b1c7a32 | ||
|
|
d9c39ba2a1 | ||
|
|
164223e844 | ||
|
|
ee327b420c | ||
|
|
6c6303cf8e |
No files matched your search
@@ -129,9 +129,16 @@ jobs:
|
|||||||
# Cambio 2026-09-14: todo push a main promueve a STAGING
|
# Cambio 2026-09-14: todo push a main promueve a STAGING
|
||||||
# automaticamente (workloads/ecommerce-staging), no a Produccion
|
# automaticamente (workloads/ecommerce-staging), no a Produccion
|
||||||
# directo -- decision del usuario para dejar de probar cambios en
|
# directo -- decision del usuario para dejar de probar cambios en
|
||||||
# vivo contra Prod. Promover a Produccion (workloads/ecommerce) es
|
# vivo contra Prod.
|
||||||
# una accion manual aparte, ver scripts/promote-to-production.sh.
|
# Cambio 2026-09-20: la promocion de Staging a Produccion (antes
|
||||||
|
# scripts/promote-to-production.sh, manual con confirmacion
|
||||||
|
# interactiva) ahora corre sola en este mismo job -- ver el step
|
||||||
|
# "Promover a Produccion (CD)" mas abajo, justo despues del de
|
||||||
|
# Staging. Decision explicita del usuario: cero gate humano entre
|
||||||
|
# Staging y Produccion. El script manual queda solo como
|
||||||
|
# herramienta de rollback/excepcion, ya no es el camino normal.
|
||||||
MANIFEST_FILE: workloads/ecommerce-staging/frontend/patches/deployment.yaml
|
MANIFEST_FILE: workloads/ecommerce-staging/frontend/patches/deployment.yaml
|
||||||
|
PROD_MANIFEST_FILE: workloads/ecommerce/frontend/patches/deployment.yaml
|
||||||
KUSTOMIZE_DIR: workloads/ecommerce-staging/frontend
|
KUSTOMIZE_DIR: workloads/ecommerce-staging/frontend
|
||||||
IMAGE_NAME: gitea.cruzcloud.net/devops/ecommerce-frontend
|
IMAGE_NAME: gitea.cruzcloud.net/devops/ecommerce-frontend
|
||||||
|
|
||||||
@@ -604,6 +611,48 @@ jobs:
|
|||||||
# sobrescribir commits ajenos o promocionar una versión antigua.
|
# sobrescribir commits ajenos o promocionar una versión antigua.
|
||||||
git push origin HEAD:main
|
git push origin HEAD:main
|
||||||
|
|
||||||
|
# Automatiza lo que antes era scripts/promote-to-production.sh (paso
|
||||||
|
# manual con confirmación interactiva, read -rp). Decisión del
|
||||||
|
# usuario 2026-09-20: cero pasos manuales entre Staging y
|
||||||
|
# Producción — la misma imagen que acaba de promocionar a Staging
|
||||||
|
# arriba se promueve sola a Producción, sin gate humano en el
|
||||||
|
# medio. Mismo sed/perl que el script manual (mismo MANIFEST, otro
|
||||||
|
# archivo), corriendo como un segundo commit separado justo
|
||||||
|
# después del de Staging — no se pisan en un solo commit porque
|
||||||
|
# Staging y Producción son releases conceptualmente distintos
|
||||||
|
# (permite revertir uno sin tocar el otro).
|
||||||
|
- name: Promover a Producción (CD)
|
||||||
|
if: steps.promotion.outputs.promote == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
VERSION="${{ steps.vars.outputs.VERSION }}"
|
||||||
|
|
||||||
|
git config user.name "Cristian Felipe"
|
||||||
|
git config user.email "[email protected]"
|
||||||
|
|
||||||
|
# Re-fetch: el step de Staging de arriba ya pusheó un commit a
|
||||||
|
# main en este mismo job -- sin este refresh, este checkout
|
||||||
|
# local queda un commit atrás y el push de abajo se rechaza.
|
||||||
|
git fetch origin main
|
||||||
|
git checkout -B main origin/main
|
||||||
|
|
||||||
|
sed -i -E "s|(image: ${IMAGE_NAME}:).*|\1${VERSION}|g" "${PROD_MANIFEST_FILE}"
|
||||||
|
|
||||||
|
perl -0777 -pi -e "s/(- name: APP_VERSION\n\s*value: ).*/\${1}${VERSION}/" "${PROD_MANIFEST_FILE}"
|
||||||
|
|
||||||
|
git add "${PROD_MANIFEST_FILE}"
|
||||||
|
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "Producción ya está en ${VERSION}."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git commit -m "chore: promote ${VERSION} to production [skip ci]"
|
||||||
|
|
||||||
|
git push origin HEAD:main
|
||||||
|
|
||||||
- name: Resumen del pipeline
|
- name: Resumen del pipeline
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
runAsNonRoot: false
|
runAsNonRoot: false
|
||||||
containers:
|
containers:
|
||||||
- name: app
|
- name: app
|
||||||
image: gitea.cruzcloud.net/devops/docs-portal:v1.0.267
|
image: gitea.cruzcloud.net/devops/docs-portal:v1.0.269
|
||||||
# El base saca TODAS las capabilities. Probado en vivo y
|
# El base saca TODAS las capabilities. Probado en vivo y
|
||||||
# revertido: con drop: ALL (aunque se agregue NET_BIND_SERVICE
|
# revertido: con drop: ALL (aunque se agregue NET_BIND_SERVICE
|
||||||
# de vuelta) el propio entrypoint de nginx:1.27-alpine falla al
|
# de vuelta) el propio entrypoint de nginx:1.27-alpine falla al
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ spec:
|
|||||||
runAsUser: 1001
|
runAsUser: 1001
|
||||||
containers:
|
containers:
|
||||||
- name: app
|
- name: app
|
||||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.266
|
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.272
|
||||||
env:
|
env:
|
||||||
# Ver comentario en workloads/ecommerce/frontend/patches/deployment.yaml
|
# Ver comentario en workloads/ecommerce/frontend/patches/deployment.yaml
|
||||||
- name: APP_VERSION
|
- name: APP_VERSION
|
||||||
value: v1.0.266
|
value: v1.0.272
|
||||||
- name: HEADLESS_PROVIDER
|
- name: HEADLESS_PROVIDER
|
||||||
value: medusa
|
value: medusa
|
||||||
# Backend COMPARTIDO con Producción a propósito (decisión del
|
# Backend COMPARTIDO con Producción a propósito (decisión del
|
||||||
|
|||||||
@@ -34,7 +34,16 @@ const SHOP_LINKS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export function Footer() {
|
export function Footer() {
|
||||||
return <footer className="bg-ari-marino text-white"><div className="mx-auto grid max-w-7xl gap-10 px-4 py-14 sm:grid-cols-2 lg:grid-cols-4"><div><div className="flex flex-col items-start gap-3"><img src="/images/brand/logo-ari.svg" alt="ARI shopping" className="h-11 w-auto" width={200} height={64} />{/* eslint-disable-line @next/next/no-img-element -- vector propio, next/image no optimiza SVG sin habilitar dangerouslyAllowSVG */}<p className="text-xs text-white/60">Tesoros para cada aventura.</p></div><div className="mt-5 flex gap-3">{SOCIAL_LINKS.map(({ label, href, Icon }) => <a key={label} href={href} target="_blank" rel="noopener noreferrer" aria-label={label} className="text-white/80 transition hover:text-ari-coral-claro"><Icon /></a>)}</div></div><FooterColumn title="Compra" links={SHOP_LINKS} /><FooterColumn title="Ayuda" links={HELP_LINKS} /><div><h3 className="font-black">Newsletter</h3><p className="mt-3 text-sm leading-6 text-white/60">Recibe lanzamientos y promociones especiales.</p><div className="mt-4 flex rounded-full bg-white p-1"><input className="min-w-0 flex-1 bg-transparent px-4 text-sm text-slate-950 outline-none" placeholder="Tu correo" /><button className="rounded-full bg-ari-coral px-4 text-sm font-black text-white">Unirme</button></div></div></div><div className="border-t border-white/10 py-5 text-center text-xs text-white/50">© 2026 ARI Shopping · Frontend headless {appVersion} · GitOps</div></footer>;
|
return <footer className="bg-ari-marino text-white"><div className="mx-auto grid max-w-7xl gap-10 px-4 py-14 sm:grid-cols-2 lg:grid-cols-4"><div><div className="flex flex-col items-start gap-3"><img src="/images/brand/logo-ari.svg" alt="ARI shopping" className="h-11 w-auto" width={200} height={64} />{/* eslint-disable-line @next/next/no-img-element -- vector propio, next/image no optimiza SVG sin habilitar dangerouslyAllowSVG */}<p className="text-xs text-white/60">Tesoros para cada aventura.</p></div><div className="mt-5 flex gap-3">{SOCIAL_LINKS.map(({ label, href, Icon }) => <a key={label} href={href} target="_blank" rel="noopener noreferrer" aria-label={label} className="text-white/80 transition hover:text-ari-coral-claro"><Icon /></a>)}</div></div><FooterColumn title="Compra" links={SHOP_LINKS} /><FooterColumn title="Ayuda" links={HELP_LINKS} />{/* min-w-0: sin esto, un grid item de texto toma como minimo su ancho
|
||||||
|
max-content (una sola linea, "Recibe lanzamientos y promociones
|
||||||
|
especiales." sin wrappear, ~335px) en vez de dejarse achicar y
|
||||||
|
wrappear dentro del track del grid -- confirmado en vivo 2026-09-20
|
||||||
|
contra un viewport real de 320px: la columna entera del footer (y
|
||||||
|
con ella, la pagina completa) quedaba forzada a 335px de ancho por
|
||||||
|
este unico parrafo. Mismo bug de fondo que el ya documentado en
|
||||||
|
product-gallery.tsx/app/product/[slug]/page.tsx, en un grid en vez
|
||||||
|
de un overflow-x-auto. */}
|
||||||
|
<div className="min-w-0"><h3 className="font-black">Newsletter</h3><p className="mt-3 text-sm leading-6 text-white/60">Recibe lanzamientos y promociones especiales.</p><div className="mt-4 flex rounded-full bg-white p-1"><input className="min-w-0 flex-1 bg-transparent px-4 text-sm text-slate-950 outline-none" placeholder="Tu correo" /><button className="rounded-full bg-ari-coral px-4 text-sm font-black text-white">Unirme</button></div></div></div><div className="border-t border-white/10 py-5 text-center text-xs text-white/50">© 2026 ARI Shopping · Frontend headless {appVersion} · GitOps</div></footer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function FooterColumn({ title, links }: { title: string; links: { label: string; href: string }[] }) {
|
function FooterColumn({ title, links }: { title: string; links: { label: string; href: string }[] }) {
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ spec:
|
|||||||
runAsUser: 1001
|
runAsUser: 1001
|
||||||
containers:
|
containers:
|
||||||
- name: app
|
- name: app
|
||||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.263
|
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.272
|
||||||
env:
|
env:
|
||||||
# La actualiza el mismo paso del CD (.gitea/workflows/build.yaml)
|
# La actualiza el mismo paso del CD (.gitea/workflows/build.yaml)
|
||||||
# que bumpea el tag de la imagen -- el footer la lee
|
# que bumpea el tag de la imagen -- el footer la lee
|
||||||
# (process.env.APP_VERSION) para mostrar la versión real
|
# (process.env.APP_VERSION) para mostrar la versión real
|
||||||
# desplegada en vez de un "v4.1" fijo.
|
# desplegada en vez de un "v4.1" fijo.
|
||||||
- name: APP_VERSION
|
- name: APP_VERSION
|
||||||
value: v1.0.263
|
value: v1.0.272
|
||||||
- name: HEADLESS_PROVIDER
|
- name: HEADLESS_PROVIDER
|
||||||
value: medusa
|
value: medusa
|
||||||
- name: MEDUSA_BACKEND_URL
|
- name: MEDUSA_BACKEND_URL
|
||||||
|
|||||||
@@ -111,14 +111,26 @@ async function medusaFetch<T>(
|
|||||||
|
|
||||||
const publishableKey = process.env.MEDUSA_PUBLISHABLE_KEY;
|
const publishableKey = process.env.MEDUSA_PUBLISHABLE_KEY;
|
||||||
|
|
||||||
|
// Sin next.revalidate/tags a proposito (reportado por el usuario
|
||||||
|
// 2026-09-20: imagenes editadas a mano en Medusa no se reflejaban en
|
||||||
|
// el storefront, pero por CSV si). Causa real: frontend-deploy corre 2
|
||||||
|
// replicas sin cacheHandler compartido -- cada pod tenia su propio
|
||||||
|
// cache en memoria de este fetch (next.revalidate:60), y el POST de
|
||||||
|
// /api/revalidate (revalidateTag) del subscriber de Medusa solo le
|
||||||
|
// llegaba a UNO de los dos pods via el Service, dejando al otro
|
||||||
|
// sirviendo la respuesta vieja hasta que el TTL expirara solo. Una
|
||||||
|
// edicion puntual + revisar al toque tenia ~50% de chance de pegarle
|
||||||
|
// al pod stale; una importacion CSV (minutos de duracion) le daba
|
||||||
|
// tiempo de sobra al TTL para expirar en ambos pods, disimulando el
|
||||||
|
// mismo bug. Las paginas que consumen esto ya son force-dynamic /
|
||||||
|
// dinamicas por diseño (ver comentario en app/page.tsx y
|
||||||
|
// app/product/[slug]/page.tsx) -- este next.revalidate competia contra
|
||||||
|
// esa intencion en vez de cumplirla. Sin este bloque, Next 15 no
|
||||||
|
// cachea el fetch por default dentro de una ruta dinamica.
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
headers: publishableKey
|
headers: publishableKey
|
||||||
? { "x-publishable-api-key": publishableKey }
|
? { "x-publishable-api-key": publishableKey }
|
||||||
: undefined,
|
: undefined,
|
||||||
next: {
|
|
||||||
revalidate: 60,
|
|
||||||
tags: ["medusa-products"],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
Reference in new issue
Block a user