mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
ci: install @types/affine__env on server build (#11252)
This commit is contained in:
8
.github/actions/deploy/deploy.mjs
vendored
8
.github/actions/deploy/deploy.mjs
vendored
@@ -12,8 +12,8 @@ const {
|
|||||||
DATABASE_NAME,
|
DATABASE_NAME,
|
||||||
CLOUD_SQL_IAM_ACCOUNT,
|
CLOUD_SQL_IAM_ACCOUNT,
|
||||||
APP_IAM_ACCOUNT,
|
APP_IAM_ACCOUNT,
|
||||||
REDIS_HOST,
|
REDIS_SERVER_HOST,
|
||||||
REDIS_PASSWORD,
|
REDIS_SERVER_PASSWORD,
|
||||||
STATIC_IP_NAME,
|
STATIC_IP_NAME,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ const createHelmCommand = ({ isDryRun }) => {
|
|||||||
`--set-string global.database.user=${DATABASE_USERNAME}`,
|
`--set-string global.database.user=${DATABASE_USERNAME}`,
|
||||||
`--set-string global.database.password=${DATABASE_PASSWORD}`,
|
`--set-string global.database.password=${DATABASE_PASSWORD}`,
|
||||||
`--set-string global.database.name=${DATABASE_NAME}`,
|
`--set-string global.database.name=${DATABASE_NAME}`,
|
||||||
`--set-string global.redis.host="${REDIS_HOST}"`,
|
`--set-string global.redis.host="${REDIS_SERVER_HOST}"`,
|
||||||
`--set-string global.redis.password="${REDIS_PASSWORD}"`,
|
`--set-string global.redis.password="${REDIS_SERVER_PASSWORD}"`,
|
||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
const serviceAnnotations = [
|
const serviceAnnotations = [
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ spec:
|
|||||||
name: pg-postgresql
|
name: pg-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.host }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
||||||
- name: REDIS_SERVER_ENABLED
|
- name: REDIS_SERVER_ENABLED
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: REDIS_SERVER_HOST
|
- name: REDIS_SERVER_HOST
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if .Values.global.database.gcloud.enabled -}}
|
{{- if .Values.enabled -}}
|
||||||
1. Get the application URL by running these commands:
|
1. Get the application URL by running these commands:
|
||||||
{{- if contains "NodePort" .Values.service.type }}
|
{{- if contains "NodePort" .Values.service.type }}
|
||||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gcloud-sql-proxy.fullname" . }})
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gcloud-sql-proxy.fullname" . }})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if .Values.global.database.gcloud.enabled -}}
|
{{- if .Values.enabled -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if .Values.global.database.gcloud.enabled -}}
|
{{- if .Values.enabled -}}
|
||||||
{{- if .Values.serviceAccount.create -}}
|
{{- if .Values.serviceAccount.create -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if .Values.global.database.gcloud.enabled -}}
|
{{- if .Values.enabled -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ spec:
|
|||||||
name: pg-postgresql
|
name: pg-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.host }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
||||||
- name: REDIS_SERVER_HOST
|
- name: REDIS_SERVER_HOST
|
||||||
value: "{{ .Values.global.redis.host }}"
|
value: "{{ .Values.global.redis.host }}"
|
||||||
- name: REDIS_SERVER_PORT
|
- name: REDIS_SERVER_PORT
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ spec:
|
|||||||
name: pg-postgresql
|
name: pg-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.host }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
||||||
- name: REDIS_SERVER_HOST
|
- name: REDIS_SERVER_HOST
|
||||||
value: "{{ .Values.global.redis.host }}"
|
value: "{{ .Values.global.redis.host }}"
|
||||||
- name: REDIS_SERVER_PORT
|
- name: REDIS_SERVER_PORT
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ spec:
|
|||||||
name: pg-postgresql
|
name: pg-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.host }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
||||||
- name: REDIS_SERVER_ENABLED
|
- name: REDIS_SERVER_ENABLED
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: REDIS_SERVER_HOST
|
- name: REDIS_SERVER_HOST
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ spec:
|
|||||||
name: pg-postgresql
|
name: pg-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.host }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
||||||
- name: REDIS_SERVER_HOST
|
- name: REDIS_SERVER_HOST
|
||||||
value: "{{ .Values.global.redis.host }}"
|
value: "{{ .Values.global.redis.host }}"
|
||||||
- name: REDIS_SERVER_PORT
|
- name: REDIS_SERVER_PORT
|
||||||
|
|||||||
1
.github/helm/affine/values.yaml
vendored
1
.github/helm/affine/values.yaml
vendored
@@ -16,7 +16,6 @@ global:
|
|||||||
name: 'affine'
|
name: 'affine'
|
||||||
password: ''
|
password: ''
|
||||||
redis:
|
redis:
|
||||||
enabled: true
|
|
||||||
host: 'redis-master'
|
host: 'redis-master'
|
||||||
port: '6379'
|
port: '6379'
|
||||||
username: ''
|
username: ''
|
||||||
|
|||||||
2
.github/workflows/build-images.yml
vendored
2
.github/workflows/build-images.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
|||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
electron-install: false
|
electron-install: false
|
||||||
extra-flags: workspaces focus @affine/server
|
extra-flags: workspaces focus @affine/server @types/affine__env
|
||||||
- name: Build Server
|
- name: Build Server
|
||||||
run: |
|
run: |
|
||||||
find packages/backend/server/src -type d -name "__tests__" -exec rm -rf {} +
|
find packages/backend/server/src -type d -name "__tests__" -exec rm -rf {} +
|
||||||
|
|||||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -114,8 +114,8 @@ jobs:
|
|||||||
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
|
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
|
||||||
GCLOUD_CONNECTION_NAME: ${{ secrets.GCLOUD_CONNECTION_NAME }}
|
GCLOUD_CONNECTION_NAME: ${{ secrets.GCLOUD_CONNECTION_NAME }}
|
||||||
GCLOUD_CLOUD_SQL_INTERNAL_ENDPOINT: ${{ secrets.GCLOUD_CLOUD_SQL_INTERNAL_ENDPOINT }}
|
GCLOUD_CLOUD_SQL_INTERNAL_ENDPOINT: ${{ secrets.GCLOUD_CLOUD_SQL_INTERNAL_ENDPOINT }}
|
||||||
REDIS_HOST: ${{ secrets.REDIS_HOST }}
|
REDIS_SERVER_HOST: ${{ secrets.REDIS_SERVER_HOST }}
|
||||||
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
|
REDIS_SERVER_PASSWORD: ${{ secrets.REDIS_SERVER_PASSWORD }}
|
||||||
CLOUD_SQL_IAM_ACCOUNT: ${{ secrets.CLOUD_SQL_IAM_ACCOUNT }}
|
CLOUD_SQL_IAM_ACCOUNT: ${{ secrets.CLOUD_SQL_IAM_ACCOUNT }}
|
||||||
APP_IAM_ACCOUNT: ${{ secrets.APP_IAM_ACCOUNT }}
|
APP_IAM_ACCOUNT: ${{ secrets.APP_IAM_ACCOUNT }}
|
||||||
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
|
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
|
||||||
|
|||||||
@@ -22,29 +22,29 @@ defineModuleConfig('redis', {
|
|||||||
db: {
|
db: {
|
||||||
desc: 'The database index of redis server to be used(Must be less than 10).',
|
desc: 'The database index of redis server to be used(Must be less than 10).',
|
||||||
default: 0,
|
default: 0,
|
||||||
env: ['REDIS_DATABASE', 'integer'],
|
env: ['REDIS_SERVER_DATABASE', 'integer'],
|
||||||
validate: val => val >= 0 && val < 10,
|
validate: val => val >= 0 && val < 10,
|
||||||
},
|
},
|
||||||
host: {
|
host: {
|
||||||
desc: 'The host of the redis server.',
|
desc: 'The host of the redis server.',
|
||||||
default: 'localhost',
|
default: 'localhost',
|
||||||
env: ['REDIS_HOST', 'string'],
|
env: ['REDIS_SERVER_HOST', 'string'],
|
||||||
},
|
},
|
||||||
port: {
|
port: {
|
||||||
desc: 'The port of the redis server.',
|
desc: 'The port of the redis server.',
|
||||||
default: 6379,
|
default: 6379,
|
||||||
env: ['REDIS_PORT', 'integer'],
|
env: ['REDIS_SERVER_PORT', 'integer'],
|
||||||
shape: z.number().positive(),
|
shape: z.number().positive(),
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
desc: 'The username of the redis server.',
|
desc: 'The username of the redis server.',
|
||||||
default: '',
|
default: '',
|
||||||
env: ['REDIS_USERNAME', 'string'],
|
env: ['REDIS_SERVER_USERNAME', 'string'],
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
desc: 'The password of the redis server.',
|
desc: 'The password of the redis server.',
|
||||||
default: '',
|
default: '',
|
||||||
env: ['REDIS_PASSWORD', 'string'],
|
env: ['REDIS_SERVER_PASSWORD', 'string'],
|
||||||
},
|
},
|
||||||
ioredis: {
|
ioredis: {
|
||||||
desc: 'The config for the ioredis client.',
|
desc: 'The config for the ioredis client.',
|
||||||
|
|||||||
@@ -12,5 +12,6 @@ defineModuleConfig('docService', {
|
|||||||
endpoint: {
|
endpoint: {
|
||||||
desc: 'The endpoint of the doc service.',
|
desc: 'The endpoint of the doc service.',
|
||||||
default: '',
|
default: '',
|
||||||
|
env: 'DOC_SERVICE_ENDPOINT',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user