-
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 #161 from hypersign-protocol/develop
Develop
- Loading branch information
Showing
16 changed files
with
21,045 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: studio-playground | ||
namespace: hypermine-development | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: studio-playground | ||
template: | ||
metadata: | ||
labels: | ||
app: studio-playground | ||
spec: | ||
containers: | ||
- name: studio-playground | ||
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/playground-server:__LATEST_RELEASE_TAG__ | ||
resources: | ||
limits: | ||
memory: "128Mi" | ||
cpu: "500m" | ||
ports: | ||
- containerPort: __PORT__ | ||
env: | ||
- name: WHITELISTED_CORS | ||
values: '["http://localhost:9000","http://localhost:9001","http://192.168.29.12:9001", "https://localhost:9001", "http://192.168.29.209:9001", "http://entity.hypersign.id","https://entity.hypersign.id","http://localhost:9001", "https://wallet-stage.hypersign.id", "http://localhost:4999","192.168.29.13","http://localhost:1234","http://localhost:4000","https://wallet-prajna.hypersign.id" "*"]' | ||
- name: NODE_ENV | ||
values: "__NODE_ENV__" | ||
- name: HOST | ||
values: "__HOST__" | ||
- name: PORT | ||
values: __PORT__ | ||
- name: LOG_FILEPATH | ||
values: "__LOG_FILEPATH__" | ||
- name: LOG_DIR | ||
values: "__LOG_DIR__" | ||
- name: LOG_TIMESTAMP_FORMAT | ||
values: "__LOG_TIMESTAMP_FORMAT__" | ||
- name: LOG_LEVEL | ||
values: "__LOG_LEVEL__" | ||
- name: DATABASE_FILEPATH | ||
values: "__DATABASE_FILEPATH__" | ||
- name: DID_METHOD_NAME | ||
values: "__DID_METHOD_NAME__" | ||
- name: DID_PREFIX | ||
values: "__DID_PREFIX__" | ||
- name: JWT_SECRET | ||
values: "__JWT_SECRET__" | ||
- name: STUDIO_SERVER_BASE_URL | ||
values: "__STUDIO_SERVER_BASE_URL__" | ||
- name: SSE_CLIENT_URL | ||
values: "__SSE_CLIENT_URL__" | ||
- name: NODE_SERVER_DID_CREATE_EP | ||
values: "__NODE_SERVER_DID_CREATE_EP__" | ||
- name: NODE_SERVER_SCHEMA_CREATE_EP | ||
values: "__NODE_SERVER_SCHEMA_CREATE_EP__" | ||
- name: MAIL_HOST | ||
values: "__MAIL_HOST__" | ||
- name: MAIL_PORT | ||
values: "__MAIL_PORT__" | ||
- name: MAIL_USERNAME | ||
values: "__MAIL_USERNAME__" | ||
- name: MAIL_PASSWORD | ||
values: "__MAIL_PASSWORD__" | ||
- name: MAIL_NAME | ||
values: "__MAIL_NAME__" | ||
- name: HID_NETWORK_RPC | ||
values: "__HID_NETWORK_RPC__" | ||
- name: HID_NETWORK_API | ||
values: "__HID_NETWORK_API__" | ||
- name: PATH_TO_ISSUE_CRED | ||
values: "__PATH_TO_ISSUE_CRED__" | ||
- name: EMAIL_CREDENTITAL_SCHEMA_ID | ||
values: "__EMAIL_CREDENTITAL_SCHEMA_ID__" | ||
- name: DB_URL | ||
values: "__DB_URL__" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: studio-playground-service | ||
namespace: hypermine-development | ||
annotations: | ||
cloud.google.com/neg: '{"ingress": true}' | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: studio-playground | ||
ports: | ||
- port: __PORT__ | ||
targetPort: __PORT__ | ||
protocol: TCP |
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,127 @@ | ||
name: Playground Build and deploy Pipeline | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
- "v[0-9]+.[0-9]+.[0-9]-rc.[0-9]+" | ||
|
||
jobs: | ||
Build-Pipeline: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: code checkout | ||
uses: actions/checkout@v3 | ||
# - name: Set Latest Tag | ||
# run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
|
||
- id: "auth" | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" | ||
|
||
- name: install gcloud cli tools | ||
uses: google-github-actions/setup-gcloud@v1 | ||
with: | ||
project_id: ${{secrets.GOOGLE_PROJECT_ID}} | ||
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} | ||
install_components: "gke-gcloud-auth-plugin" | ||
export_default_credentials: true | ||
- name: "Use gcloud CLI" | ||
run: "gcloud info" | ||
- name: "Docker Auth" | ||
run: gcloud auth configure-docker ${{secrets.GOOGLE_ARTIFACT_URL}} | ||
- name: "Docker Build and Push" | ||
working-directory: server | ||
env: | ||
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} | ||
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}} | ||
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}} | ||
run: | ||
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/playground-server:${{ env.LATEST_RELEASE_TAG }} . | ||
|
||
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/playground-server:${{ env.LATEST_RELEASE_TAG }} | ||
Deploy-Pipeline: | ||
needs: [Build-Pipeline] | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: code checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Latest Tag | ||
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
|
||
- id: "auth" | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" | ||
- name: install gcloud cli tools | ||
uses: google-github-actions/setup-gcloud@v1 | ||
with: | ||
project_id: ${{secrets.GOOGLE_PROJECT_ID}} | ||
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} | ||
install_components: "gke-gcloud-auth-plugin" | ||
export_default_credentials: true | ||
- name: "Configure kubectl" | ||
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1 | ||
- name: Replace tags | ||
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \; | ||
- name: "Replace secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \; | ||
- name: "Replace secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \; | ||
- name: "Replace secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__NODE_ENV__#${{ vars.NODE_ENV }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__HOST__#${{ vars.HOST }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__PORT__#${{ vars.PORT }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__LOG_FILEPATH__#${{ vars.LOG_FILEPATH }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__LOG_DIR__#${{ vars.LOG_DIR }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__LOG_TIMESTAMP_FORMAT__#${{ vars.LOG_TIMESTAMP_FORMAT }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__DATABASE_FILEPATH__#${{ vars.DATABASE_FILEPATH }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__DID_METHOD_NAME__#${{ vars.DID_METHOD_NAME }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__DID_PREFIX__#${{ vars.DID_PREFIX }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__JWT_SECRET__#${{ vars.JWT_SECRET }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__STUDIO_SERVER_BASE_URL__#${{ vars.STUDIO_SERVER_BASE_URL }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__SSE_CLIENT_URL__#${{ vars.SSE_CLIENT_URL }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__NODE_SERVER_DID_CREATE_EP__#${{ vars.NODE_SERVER_DID_CREATE_EP }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__NODE_SERVER_SCHEMA_CREATE_EP__#${{ vars.NODE_SERVER_SCHEMA_CREATE_EP }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MAIL_HOST__#${{ vars.MAIL_HOST }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MAIL_PORT__#${{ vars.MAIL_PORT }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MAIL_USERNAME__#${{ vars.MAIL_USERNAME }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MAIL_PASSWORD__#${{ vars.MAIL_PASSWORD }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MAIL_NAME__#${{ vars.MAIL_NAME }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__HID_NETWORK_RPC__#${{ vars.HID_NETWORK_RPC }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__HID_NETWORK_API__#${{ vars.HID_NETWORK_API }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__PATH_TO_ISSUE_CRED__#${{ vars.PATH_TO_ISSUE_CRED }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__EMAIL_CREDENTITAL_SCHEMA_ID__#${{ vars.EMAIL_CREDENTITAL_SCHEMA_ID }}#" {} \; | ||
- name: "Replace Secrets" | ||
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__DB_URL__#${{ vars.DB_URL }}#" {} \; | ||
- name: "Deploy to GKE" | ||
run: kubectl apply -f .deploy/deployment.yaml |
File renamed without changes.
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,6 +1,12 @@ | ||
FROM node:16 | ||
WORKDIR /usr/src/app | ||
ADD ./server/ /usr/src/app/ | ||
RUN npm cache clean --force | ||
COPY ./package.json . | ||
COPY ./tsconfig.json . | ||
COPY . . | ||
RUN npm install | ||
CMD ["npm","run", "dev"] | ||
RUN npm run build | ||
CMD ["npm","run", "start"] | ||
|
||
|
||
|
||
|
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 was deleted.
Oops, something went wrong.
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.