Skip to content

Commit af03979

Browse files
author
geisterfurz007
authored
Upgrade to Payload 3 (#300)
* WIP - Upgrade to payload 3 * Prepare deployment * lint * Pipeline I * Pipeline II * Pipeline III * Pipeline VI * Pipeline V * WIP * Does this build now? * Pipeline * Pipeline! * Pipeline!! * Pipeline!!! * Pipeline!!!! * Pipeline!!!!! * Pipeline!!!!!! * WIP migrations * Remove CMS deployment * Fix CMS endpoint * Fix migrations * Fix Dockerfile * Fix web deployment * Fix typesense reference * fix backend env variable * fix allowed images * Fix pipeline * fix docker compose command * Fix playwright image * Put test containers back * Fix e2e commit templating * Self-review
1 parent 59e5012 commit af03979

File tree

130 files changed

+4787
-4607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4787
-4607
lines changed

.github/workflows/ensure-integrity.yml

+5-25
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,7 @@ jobs:
3333
sub-project: web
3434
token: ${{ secrets.GITHUB_TOKEN }}
3535
build-args: |
36-
FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
37-
NEXT_PUBLIC_PAYLOAD_URL=${{ github.ref == 'refs/heads/master' && 'https://admin.staging.yestheory.family' || 'https://admin.yestheory.family' }}
38-
39-
docker-build-cms:
40-
name: "Docker Build CMS"
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v3
44-
- uses: ./.github/actions/docker-build
45-
name: "Build Container"
46-
with:
47-
sub-project: cms
48-
token: ${{ secrets.GITHUB_TOKEN }}
49-
build-args: |
50-
PAYLOAD_PUBLIC_WEB_FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
36+
NEXT_PUBLIC_FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
5137
5238
chromatic-deployment:
5339
name: "Chromatic Deployment"
@@ -70,7 +56,7 @@ jobs:
7056

7157
e2e-test:
7258
name: "Playwright E2E-Test"
73-
needs: [ docker-build-server, docker-build-web, docker-build-cms ]
59+
needs: [ docker-build-server, docker-build-web ]
7460
runs-on: ubuntu-latest
7561
steps:
7662
- uses: actions/checkout@v3
@@ -90,9 +76,9 @@ jobs:
9076

9177
- name: Run e2e tests
9278
run: |
93-
docker-compose -f docker-compose.e2e.yml up --no-build -d server cms web
94-
docker-compose -f docker-compose.e2e.yml run playwright
95-
docker-compose -f docker-compose.e2e.yml down
79+
docker compose -f docker-compose.e2e.yml up --no-build -d server web
80+
docker compose -f docker-compose.e2e.yml run playwright
81+
docker compose -f docker-compose.e2e.yml down
9682
# TODO upload artifacts like videos / reports
9783

9884
remove-test-containers:
@@ -114,9 +100,3 @@ jobs:
114100
with:
115101
sub-project: web
116102
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }}
117-
118-
- name: Delete cms image
119-
uses: ./.github/actions/delete-image
120-
with:
121-
sub-project: cms
122-
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }}

.github/workflows/lint-and-test.yml

-10
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,3 @@ jobs:
4444
name: "Install and tsc server"
4545
with:
4646
command: workspace @yestheory.family/server tsc --noEmit
47-
48-
tsc-cms:
49-
name: "TSC CMS"
50-
runs-on: ubuntu-latest
51-
steps:
52-
- uses: actions/checkout@v3
53-
- uses: ./.github/actions/yarn-action
54-
name: "Install and tsc cms"
55-
with:
56-
command: workspace @yestheory.family/cms tsc --noEmit

deployment/helm/templates/backend/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
- name: DISCORD_SCOPES
5353
value: "identify,guilds.join"
5454
- name: CMS_ENDPOINT
55-
value: "http://ytf-cms-service/api/graphql"
55+
value: "http://ytf-web-service/api/graphql"
5656
- name: FRONTEND_HOST
5757
value: https://{{ .Values.common.baseDomain }}
5858

deployment/helm/templates/cms/deployment.yaml

-74
This file was deleted.

deployment/helm/templates/cms/ingress.yaml

-32
This file was deleted.

deployment/helm/templates/cms/service.yaml

-13
This file was deleted.

deployment/helm/templates/web/deployment.yaml

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ spec:
2020
ports:
2121
- name: next
2222
containerPort: 3000
23-
livenessProbe:
24-
initialDelaySeconds: 5
25-
periodSeconds: 10
26-
httpGet:
27-
path: /
28-
port: 3000
2923
env:
3024
- name: SERVER_BACKEND_GRAPHQL_URL
3125
value: http://ytf-backend-service/graphql
32-
- name: TYPESENSE_DIRECT_URL
26+
- name: TYPESENSE_API_URL
3327
value: http://ytf-typesense-service:8108
3428
- name: FRONTEND_URL
3529
value: https://{{ .Values.common.baseDomain }}
30+
{{- range .Values.web.secret.secrets }}
31+
- name: {{ .name }}
32+
valueFrom:
33+
secretKeyRef:
34+
name: ytf-web-secret
35+
key: {{ .name }}
36+
{{- end }}

deployment/helm/templates/cms/secret.yaml deployment/helm/templates/web/secret.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{- with .Values.cms.secret }}
1+
{{- with .Values.web.secret }}
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: ytf-cms-secret
5+
name: ytf-web-secret
66
data: {{- range $secret := .secrets }}
77
{{ $secret.name }}: {{ $secret.value | toString | b64enc }}
88
{{- end }}

deployment/helm/values.yaml

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ common:
1414
baseDomain: yestheory.family
1515
certName: cert
1616

17-
cms:
17+
web:
1818
deployment:
1919
image:
20-
name: ghcr.io/yes-theory-fam/yestheory-family-cms
20+
name: ghcr.io/yes-theory-fam/yestheory-family-web
2121
tag: latest
22-
2322
secret:
2423
secrets:
2524
- name: PAYLOAD_SECRET
@@ -33,12 +32,6 @@ cms:
3332
- name: YESBOT_API_AUTH_TOKEN
3433
value:
3534

36-
web:
37-
deployment:
38-
image:
39-
name: ghcr.io/yes-theory-fam/yestheory-family-web
40-
tag: latest
41-
4235
backend:
4336
deployment:
4437
image:

docker-compose.e2e.yml

+8-28
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ services:
3333
DISCORD_CLIENT_SECRET: skipped
3434
DISCORD_SCOPES: skipped
3535

36-
CMS_ENDPOINT: "http://cms:3001/api/graphql"
36+
CMS_ENDPOINT: "http://web:3000/api/graphql"
3737
CMS_API_KEY: e2e-api-key
3838
depends_on:
39-
cms:
40-
condition: 'service_healthy'
4139
postgres:
4240
condition: 'service_healthy'
4341

@@ -46,36 +44,19 @@ services:
4644
environment:
4745
SERVER_BACKEND_GRAPHQL_URL: http://server:5000/graphql
4846
FRONTEND_URL: http://web:3000
49-
ports:
50-
- "3000:3000"
51-
depends_on:
52-
- server
53-
54-
cms:
55-
image: ghcr.io/yes-theory-fam/yestheory-family-cms:COMMIT_HASH
56-
environment:
57-
ENABLE_DATASEEDER: "true"
58-
PAYLOAD_SECRET: asdfghjkl
59-
DATABASE_URI: "postgresql://ytfe2e:ytfe2e@postgres:5432/payload?schema=public"
60-
TYPESENSE_API_KEY: 1234567890
47+
PAYLOAD_SECRET: e2e-secret
48+
DATABASE_URI: postgresql://ytfe2e:ytfe2e@postgres:5432/payload?schema=public
6149
TYPESENSE_API_URL: http://typesense:8108
50+
TYPESENSE_API_KEY: 1234567890
6251
BACKEND_URL: http://server:5000
6352
INTERNAL_BACKEND_URL: http://server:5001
6453
YESBOT_API_AUTH_TOKEN: yesbot-api-token
65-
INITIAL_ADMIN_ID: skipped
54+
INITIAL_ADMIN_ID: 1234567890
6655
PAYLOAD_API_KEY: e2e-api-key
67-
healthcheck:
68-
test: ["CMD-SHELL", "curl --silent --fail http://localhost:3001/admin > /dev/null || exit 1"]
69-
start_period: 5s
70-
interval: 1s
71-
retries: 10
7256
ports:
73-
- "3001:3001"
57+
- "3000:3000"
7458
depends_on:
75-
postgres:
76-
condition: 'service_healthy'
77-
typesense:
78-
condition: 'service_started'
59+
- server
7960

8061
typesense:
8162
image: typesense/typesense:0.25.1
@@ -89,7 +70,7 @@ services:
8970
- "typesense-data:/data"
9071

9172
playwright:
92-
image: mcr.microsoft.com/playwright:v1.43.1-focal
73+
image: mcr.microsoft.com/playwright:v1.46.1-focal
9374
entrypoint: "/bin/bash"
9475
command: "./wait-for-it.sh -t 30 --strict server:5000 -- ./install-and-run.sh"
9576
working_dir: /e2e
@@ -100,7 +81,6 @@ services:
10081
depends_on:
10182
- web
10283
- server
103-
- cms
10484
- postgres
10585
- typesense
10686

packages/cms/.env.example

-28
This file was deleted.

0 commit comments

Comments
 (0)