Skip to content

Commit

Permalink
Upgrade to Payload 3 (#300)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
geisterfurz007 authored Aug 24, 2024
1 parent 59e5012 commit af03979
Show file tree
Hide file tree
Showing 130 changed files with 4,787 additions and 4,607 deletions.
30 changes: 5 additions & 25 deletions .github/workflows/ensure-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,7 @@ jobs:
sub-project: web
token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
NEXT_PUBLIC_PAYLOAD_URL=${{ github.ref == 'refs/heads/master' && 'https://admin.staging.yestheory.family' || 'https://admin.yestheory.family' }}
docker-build-cms:
name: "Docker Build CMS"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/docker-build
name: "Build Container"
with:
sub-project: cms
token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
PAYLOAD_PUBLIC_WEB_FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
NEXT_PUBLIC_FRONTEND_URL=${{ github.ref == 'refs/heads/master' && 'https://staging.yestheory.family' || 'https://yestheory.family' }}
chromatic-deployment:
name: "Chromatic Deployment"
Expand All @@ -70,7 +56,7 @@ jobs:

e2e-test:
name: "Playwright E2E-Test"
needs: [ docker-build-server, docker-build-web, docker-build-cms ]
needs: [ docker-build-server, docker-build-web ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -90,9 +76,9 @@ jobs:

- name: Run e2e tests
run: |
docker-compose -f docker-compose.e2e.yml up --no-build -d server cms web
docker-compose -f docker-compose.e2e.yml run playwright
docker-compose -f docker-compose.e2e.yml down
docker compose -f docker-compose.e2e.yml up --no-build -d server web
docker compose -f docker-compose.e2e.yml run playwright
docker compose -f docker-compose.e2e.yml down
# TODO upload artifacts like videos / reports

remove-test-containers:
Expand All @@ -114,9 +100,3 @@ jobs:
with:
sub-project: web
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }}

- name: Delete cms image
uses: ./.github/actions/delete-image
with:
sub-project: cms
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }}
10 changes: 0 additions & 10 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,3 @@ jobs:
name: "Install and tsc server"
with:
command: workspace @yestheory.family/server tsc --noEmit

tsc-cms:
name: "TSC CMS"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/yarn-action
name: "Install and tsc cms"
with:
command: workspace @yestheory.family/cms tsc --noEmit
2 changes: 1 addition & 1 deletion deployment/helm/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- name: DISCORD_SCOPES
value: "identify,guilds.join"
- name: CMS_ENDPOINT
value: "http://ytf-cms-service/api/graphql"
value: "http://ytf-web-service/api/graphql"
- name: FRONTEND_HOST
value: https://{{ .Values.common.baseDomain }}

Expand Down
74 changes: 0 additions & 74 deletions deployment/helm/templates/cms/deployment.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions deployment/helm/templates/cms/ingress.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions deployment/helm/templates/cms/service.yaml

This file was deleted.

15 changes: 8 additions & 7 deletions deployment/helm/templates/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ spec:
ports:
- name: next
containerPort: 3000
livenessProbe:
initialDelaySeconds: 5
periodSeconds: 10
httpGet:
path: /
port: 3000
env:
- name: SERVER_BACKEND_GRAPHQL_URL
value: http://ytf-backend-service/graphql
- name: TYPESENSE_DIRECT_URL
- name: TYPESENSE_API_URL
value: http://ytf-typesense-service:8108
- name: FRONTEND_URL
value: https://{{ .Values.common.baseDomain }}
{{- range .Values.web.secret.secrets }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: ytf-web-secret
key: {{ .name }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- with .Values.cms.secret }}
{{- with .Values.web.secret }}
apiVersion: v1
kind: Secret
metadata:
name: ytf-cms-secret
name: ytf-web-secret
data: {{- range $secret := .secrets }}
{{ $secret.name }}: {{ $secret.value | toString | b64enc }}
{{- end }}
Expand Down
11 changes: 2 additions & 9 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ common:
baseDomain: yestheory.family
certName: cert

cms:
web:
deployment:
image:
name: ghcr.io/yes-theory-fam/yestheory-family-cms
name: ghcr.io/yes-theory-fam/yestheory-family-web
tag: latest

secret:
secrets:
- name: PAYLOAD_SECRET
Expand All @@ -33,12 +32,6 @@ cms:
- name: YESBOT_API_AUTH_TOKEN
value:

web:
deployment:
image:
name: ghcr.io/yes-theory-fam/yestheory-family-web
tag: latest

backend:
deployment:
image:
Expand Down
36 changes: 8 additions & 28 deletions docker-compose.e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ services:
DISCORD_CLIENT_SECRET: skipped
DISCORD_SCOPES: skipped

CMS_ENDPOINT: "http://cms:3001/api/graphql"
CMS_ENDPOINT: "http://web:3000/api/graphql"
CMS_API_KEY: e2e-api-key
depends_on:
cms:
condition: 'service_healthy'
postgres:
condition: 'service_healthy'

Expand All @@ -46,36 +44,19 @@ services:
environment:
SERVER_BACKEND_GRAPHQL_URL: http://server:5000/graphql
FRONTEND_URL: http://web:3000
ports:
- "3000:3000"
depends_on:
- server

cms:
image: ghcr.io/yes-theory-fam/yestheory-family-cms:COMMIT_HASH
environment:
ENABLE_DATASEEDER: "true"
PAYLOAD_SECRET: asdfghjkl
DATABASE_URI: "postgresql://ytfe2e:ytfe2e@postgres:5432/payload?schema=public"
TYPESENSE_API_KEY: 1234567890
PAYLOAD_SECRET: e2e-secret
DATABASE_URI: postgresql://ytfe2e:ytfe2e@postgres:5432/payload?schema=public
TYPESENSE_API_URL: http://typesense:8108
TYPESENSE_API_KEY: 1234567890
BACKEND_URL: http://server:5000
INTERNAL_BACKEND_URL: http://server:5001
YESBOT_API_AUTH_TOKEN: yesbot-api-token
INITIAL_ADMIN_ID: skipped
INITIAL_ADMIN_ID: 1234567890
PAYLOAD_API_KEY: e2e-api-key
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail http://localhost:3001/admin > /dev/null || exit 1"]
start_period: 5s
interval: 1s
retries: 10
ports:
- "3001:3001"
- "3000:3000"
depends_on:
postgres:
condition: 'service_healthy'
typesense:
condition: 'service_started'
- server

typesense:
image: typesense/typesense:0.25.1
Expand All @@ -89,7 +70,7 @@ services:
- "typesense-data:/data"

playwright:
image: mcr.microsoft.com/playwright:v1.43.1-focal
image: mcr.microsoft.com/playwright:v1.46.1-focal
entrypoint: "/bin/bash"
command: "./wait-for-it.sh -t 30 --strict server:5000 -- ./install-and-run.sh"
working_dir: /e2e
Expand All @@ -100,7 +81,6 @@ services:
depends_on:
- web
- server
- cms
- postgres
- typesense

Expand Down
28 changes: 0 additions & 28 deletions packages/cms/.env.example

This file was deleted.

Loading

0 comments on commit af03979

Please sign in to comment.