-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from co-co-gong/feat#12
feat(user): read user, update user, delete user
- Loading branch information
Showing
18 changed files
with
394 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,10 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Credentials ### | ||
.env | ||
k8s/secrets.yaml | ||
|
||
### Etc ### | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: backend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: backend | ||
template: | ||
metadata: | ||
labels: | ||
app: backend | ||
spec: | ||
containers: | ||
- name: backend | ||
image: zerohertzkr/dev:latest | ||
env: | ||
- name: POSTGRES_HOST | ||
value: "postgres" | ||
- name: POSTGRES_PORT | ||
valueFrom: | ||
configMapKeyRef: | ||
name: postgres-config | ||
key: POSTGRES_PORT | ||
- name: POSTGRES_USER | ||
valueFrom: | ||
configMapKeyRef: | ||
name: postgres-config | ||
key: POSTGRES_USER | ||
- name: POSTGRES_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: postgres-secret | ||
key: POSTGRES_PASSWORD | ||
- name: POSTGRES_DB | ||
valueFrom: | ||
configMapKeyRef: | ||
name: postgres-config | ||
key: POSTGRES_DB | ||
- name: GITHUB_REDIRECT_URI | ||
valueFrom: | ||
secretKeyRef: | ||
name: oauth-secret | ||
key: GITHUB_REDIRECT_URI | ||
- name: GITHUB_CLIENT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: oauth-secret | ||
key: GITHUB_CLIENT_ID | ||
- name: GITHUB_CLIENT_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: oauth-secret | ||
key: GITHUB_CLIENT_SECRET | ||
- name: JWT_SECRET_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: jwt-secret | ||
key: JWT_SECRET_KEY | ||
command: | ||
- "scripts/local.sh" | ||
# command: | ||
# - "sh" | ||
# - "-c" | ||
# - "tail -f /dev/null" | ||
volumeMounts: | ||
- mountPath: /home/zerohertz/workspace | ||
name: backend-storage | ||
volumes: | ||
- name: backend-storage | ||
hostPath: | ||
path: /home/zerohertz/Zerohertz/co-co-gong-server | ||
type: DirectoryOrCreate | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backend | ||
spec: | ||
ports: | ||
- port: 8080 | ||
selector: | ||
app: backend | ||
--- | ||
apiVersion: traefik.io/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: co-co-gong | ||
spec: | ||
entryPoints: | ||
- websecure | ||
routes: | ||
- match: Host(`co-co-gong.zerohertz.xyz`) | ||
kind: Rule | ||
services: | ||
- name: backend | ||
port: 8080 | ||
tls: | ||
certResolver: zerohertz-resolver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: postgres | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: postgres | ||
template: | ||
metadata: | ||
labels: | ||
app: postgres | ||
spec: | ||
containers: | ||
- name: postgres | ||
image: postgres:latest | ||
env: | ||
- name: POSTGRES_DB | ||
valueFrom: | ||
configMapKeyRef: | ||
name: postgres-config | ||
key: POSTGRES_DB | ||
- name: POSTGRES_USER | ||
valueFrom: | ||
configMapKeyRef: | ||
name: postgres-config | ||
key: POSTGRES_USER | ||
- name: POSTGRES_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: postgres-secret | ||
key: POSTGRES_PASSWORD | ||
- name: PGDATA | ||
value: /var/lib/postgresql/data/pgdata | ||
ports: | ||
- containerPort: 5432 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres | ||
spec: | ||
ports: | ||
- port: 5432 | ||
selector: | ||
app: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
#!/bin/bash | ||
|
||
source .env | ||
export JWT_SECRET_KEY=$(openssl rand -base64 32) | ||
|
||
docker build --no-cache \ | ||
--build-arg POSTGRES_HOST=${POSTGRES_HOST} \ | ||
--build-arg POSTGRES_PORT=${POSTGRES_PORT} \ | ||
--build-arg POSTGRES_USER=${POSTGRES_USER} \ | ||
--build-arg POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \ | ||
--build-arg POSTGRES_DB=${POSTGRES_DB} \ | ||
--build-arg GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID} \ | ||
--build-arg GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET} \ | ||
--build-arg JWT_SECRET_KEY=${JWT_SECRET_KEY} \ | ||
-t test . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
kubectl delete ns co-co-gong | ||
kubectl create ns co-co-gong | ||
kubectl apply -n co-co-gong -f k8s | ||
|
||
# kubectl exec -it -n co-co-gong deploy/backend -- zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
./gradlew build | ||
java -jar build/libs/*SNAPSHOT.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.