Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acb65fa5bb | |||
| 53ab415713 | |||
| a330e342e1 | |||
| 0f841e27fc | |||
| cd25d98384 | |||
| e9fceb78b3 | |||
| 0cae8adef8 | |||
| 674626ba1e | |||
| 903fbf55d5 | |||
| 7bf9cf9734 | |||
| bf159f8b1f | |||
| 2f3d4d8d01 | |||
| db9bb31702 | |||
| b38db65dde | |||
| 3178f81b99 | |||
| 544d65959d | |||
| f38bb244a4 | |||
| abee344ca4 |
@@ -340,7 +340,7 @@ jobs:
|
|||||||
name: Update Infra Image Tags
|
name: Update Infra Image Tags
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [docker]
|
needs: [docker]
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push'
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
TAG: ${{ inputs.tag }}
|
TAG: ${{ inputs.tag }}
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/infra
|
cd /tmp/infra
|
||||||
PROD_KUST="apps/groombook/overlays/prod/kustomization.yaml"
|
PROD_KUST="apps/overlays/prod/kustomization.yaml"
|
||||||
|
|
||||||
SHORT_SHA="${TAG##*-}"
|
SHORT_SHA="${TAG##*-}"
|
||||||
export SHORT_SHA
|
export SHORT_SHA
|
||||||
@@ -70,14 +70,14 @@ jobs:
|
|||||||
yq -i '(.images[] | select(.name == "ghcr.io/groombook/seed")).newTag = env(TAG)' "$PROD_KUST"
|
yq -i '(.images[] | select(.name == "ghcr.io/groombook/seed")).newTag = env(TAG)' "$PROD_KUST"
|
||||||
|
|
||||||
# Update migrate Job name to include short SHA (immutable template fix)
|
# Update migrate Job name to include short SHA (immutable template fix)
|
||||||
MIGRATE_JOB="apps/groombook/base/migrate-job.yaml"
|
MIGRATE_JOB="apps/base/migrate-job.yaml"
|
||||||
if [ -f "$MIGRATE_JOB" ]; then
|
if [ -f "$MIGRATE_JOB" ]; then
|
||||||
yq -i '.metadata.name = "migrate-schema-" + env(SHORT_SHA)' "$MIGRATE_JOB"
|
yq -i '.metadata.name = "migrate-schema-" + env(SHORT_SHA)' "$MIGRATE_JOB"
|
||||||
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$MIGRATE_JOB"
|
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$MIGRATE_JOB"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update seed Job name to include short SHA (immutable template fix)
|
# Update seed Job name to include short SHA (immutable template fix)
|
||||||
SEED_JOB="apps/groombook/base/seed-job.yaml"
|
SEED_JOB="apps/base/seed-job.yaml"
|
||||||
if [ -f "$SEED_JOB" ]; then
|
if [ -f "$SEED_JOB" ]; then
|
||||||
yq -i '.metadata.name = "seed-test-data-" + env(SHORT_SHA)' "$SEED_JOB"
|
yq -i '.metadata.name = "seed-test-data-" + env(SHORT_SHA)' "$SEED_JOB"
|
||||||
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$SEED_JOB"
|
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$SEED_JOB"
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
git config user.name "groombook-engineer[bot]"
|
git config user.name "groombook-engineer[bot]"
|
||||||
git config user.email "3141748+groombook-engineer[bot]@users.noreply.github.com"
|
git config user.email "3141748+groombook-engineer[bot]@users.noreply.github.com"
|
||||||
git checkout -b "release/promote-prod-${TAG}"
|
git checkout -b "release/promote-prod-${TAG}"
|
||||||
git add apps/groombook/overlays/prod/ apps/groombook/base/migrate-job.yaml apps/groombook/base/seed-job.yaml
|
git add apps/overlays/prod/ apps/base/migrate-job.yaml apps/base/seed-job.yaml
|
||||||
git commit -m "release: promote ${TAG} to production"
|
git commit -m "release: promote ${TAG} to production"
|
||||||
git push -u origin "release/promote-prod-${TAG}"
|
git push -u origin "release/promote-prod-${TAG}"
|
||||||
gh pr create \
|
gh pr create \
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Updating UAT overlay image tags to: $TAG"
|
echo "Updating UAT overlay image tags to: $TAG"
|
||||||
cd /tmp/infra
|
cd /tmp/infra
|
||||||
UAT_KUST="apps/groombook/overlays/uat/kustomization.yaml"
|
UAT_KUST="apps/overlays/uat/kustomization.yaml"
|
||||||
|
|
||||||
if [ ! -f "$UAT_KUST" ]; then
|
if [ ! -f "$UAT_KUST" ]; then
|
||||||
echo "ERROR: UAT overlay not found at $UAT_KUST. Ensure GRO-427 has been completed."
|
echo "ERROR: UAT overlay not found at $UAT_KUST. Ensure GRO-427 has been completed."
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
yq -i '(.images[] | select(.name == "ghcr.io/groombook/seed")).newTag = env(TAG)' "$UAT_KUST"
|
yq -i '(.images[] | select(.name == "ghcr.io/groombook/seed")).newTag = env(TAG)' "$UAT_KUST"
|
||||||
|
|
||||||
# Update migrate Job name to include short SHA (immutable template fix)
|
# Update migrate Job name to include short SHA (immutable template fix)
|
||||||
MIGRATE_JOB="apps/groombook/base/migrate-job.yaml"
|
MIGRATE_JOB="apps/base/migrate-job.yaml"
|
||||||
if [ -f "$MIGRATE_JOB" ]; then
|
if [ -f "$MIGRATE_JOB" ]; then
|
||||||
yq -i '.metadata.name = "migrate-schema-" + env(SHORT_SHA)' "$MIGRATE_JOB"
|
yq -i '.metadata.name = "migrate-schema-" + env(SHORT_SHA)' "$MIGRATE_JOB"
|
||||||
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$MIGRATE_JOB"
|
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$MIGRATE_JOB"
|
||||||
@@ -64,7 +64,7 @@ jobs:
|
|||||||
# Update seed Job name to include short SHA (immutable template fix)
|
# Update seed Job name to include short SHA (immutable template fix)
|
||||||
# NOTE: Do NOT update the image tag here — let the Kustomize images transformer
|
# NOTE: Do NOT update the image tag here — let the Kustomize images transformer
|
||||||
# in the UAT overlay handle it via newTag. This avoids the immutable template issue.
|
# in the UAT overlay handle it via newTag. This avoids the immutable template issue.
|
||||||
SEED_JOB="apps/groombook/base/seed-job.yaml"
|
SEED_JOB="apps/base/seed-job.yaml"
|
||||||
if [ -f "$SEED_JOB" ]; then
|
if [ -f "$SEED_JOB" ]; then
|
||||||
yq -i '.metadata.name = "seed-test-data-" + env(SHORT_SHA)' "$SEED_JOB"
|
yq -i '.metadata.name = "seed-test-data-" + env(SHORT_SHA)' "$SEED_JOB"
|
||||||
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$SEED_JOB"
|
yq -i '.metadata.annotations."groombook.app/deploy-version" = env(TAG)' "$SEED_JOB"
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
git config user.name "groombook-engineer[bot]"
|
git config user.name "groombook-engineer[bot]"
|
||||||
git config user.email "3141748+groombook-engineer[bot]@users.noreply.github.com"
|
git config user.email "3141748+groombook-engineer[bot]@users.noreply.github.com"
|
||||||
git checkout -b "chore/update-uat-image-tags-${TAG}"
|
git checkout -b "chore/update-uat-image-tags-${TAG}"
|
||||||
git add apps/groombook/overlays/uat/ apps/groombook/base/migrate-job.yaml apps/groombook/base/seed-job.yaml
|
git add apps/overlays/uat/ apps/base/migrate-job.yaml apps/base/seed-job.yaml
|
||||||
git commit -m "chore: promote ${TAG} to UAT"
|
git commit -m "chore: promote ${TAG} to UAT"
|
||||||
|
|
||||||
git push -u origin "chore/update-uat-image-tags-${TAG}"
|
git push -u origin "chore/update-uat-image-tags-${TAG}"
|
||||||
|
|||||||
@@ -883,6 +883,7 @@ async function seed() {
|
|||||||
let appointmentCount = 0;
|
let appointmentCount = 0;
|
||||||
let invoiceCount = 0;
|
let invoiceCount = 0;
|
||||||
let visitLogCount = 0;
|
let visitLogCount = 0;
|
||||||
|
let paidInvoiceCounter = 0;
|
||||||
|
|
||||||
// Process in batches per client to keep memory manageable
|
// Process in batches per client to keep memory manageable
|
||||||
const apptBatchSize = 100;
|
const apptBatchSize = 100;
|
||||||
@@ -977,8 +978,11 @@ async function seed() {
|
|||||||
|
|
||||||
const invoiceStatus = rand() < 0.95 ? "paid" as const : "pending" as const;
|
const invoiceStatus = rand() < 0.95 ? "paid" as const : "pending" as const;
|
||||||
const paidAt = invoiceStatus === "paid" ? new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000) : null;
|
const paidAt = invoiceStatus === "paid" ? new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000) : null;
|
||||||
|
paidInvoiceCounter++;
|
||||||
|
const stripePaymentIntentId = invoiceStatus === "paid"
|
||||||
|
? `pi_test_seed_${String(paidInvoiceCounter).padStart(6, "0")}`
|
||||||
|
: null;
|
||||||
|
|
||||||
const stripePaymentIntentId = invoiceStatus === "paid" && rand() < 0.2 ? `pi_test_${uuid().replace(/-/g, "").slice(0, 24)}` : null;
|
|
||||||
invoiceBatch.push({
|
invoiceBatch.push({
|
||||||
id: invoiceId,
|
id: invoiceId,
|
||||||
appointmentId: apptId,
|
appointmentId: apptId,
|
||||||
@@ -1094,14 +1098,16 @@ async function seed() {
|
|||||||
const taxCents = Math.round(effectivePrice * 0.08);
|
const taxCents = Math.round(effectivePrice * 0.08);
|
||||||
const totalCents = effectivePrice + taxCents + tipCents;
|
const totalCents = effectivePrice + taxCents + tipCents;
|
||||||
const paidAt = new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000);
|
const paidAt = new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000);
|
||||||
const stripePaymentIntentId = rand() < 0.2 ? `pi_test_${uuid().replace(/-/g, "").slice(0, 24)}` : null;
|
paidInvoiceCounter++;
|
||||||
|
|
||||||
invoiceBatch.push({
|
invoiceBatch.push({
|
||||||
id: invoiceId, appointmentId: apptId, clientId,
|
id: invoiceId, appointmentId: apptId, clientId,
|
||||||
subtotalCents: effectivePrice, taxCents, tipCents, totalCents,
|
subtotalCents: effectivePrice, taxCents, tipCents, totalCents,
|
||||||
status: "paid" as const,
|
status: "paid" as const,
|
||||||
paymentMethod: pick(["cash", "card", "card", "card", "check"]) as "cash" | "card" | "check",
|
paymentMethod: pick(["cash", "card", "card", "card", "check"]) as "cash" | "card" | "check",
|
||||||
paidAt, stripePaymentIntentId, notes: null,
|
paidAt,
|
||||||
|
stripePaymentIntentId: `pi_test_seed_${String(paidInvoiceCounter).padStart(6, "0")}`,
|
||||||
|
notes: null,
|
||||||
});
|
});
|
||||||
lineItemBatch.push({
|
lineItemBatch.push({
|
||||||
id: uuid(), invoiceId, description: svc.name, quantity: 1,
|
id: uuid(), invoiceId, description: svc.name, quantity: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user