diff --git a/.forgejo/workflows/deploy-edge-proxy.yml b/.forgejo/workflows/deploy-edge-proxy.yml new file mode 100644 index 0000000..87125e3 --- /dev/null +++ b/.forgejo/workflows/deploy-edge-proxy.yml @@ -0,0 +1,31 @@ +# name: Deploy Edge Proxy +# run-name: ${{ gitea.actor }} Deploy Edge Proxy +# on: +# push: +# branches: [ master ] + +# env: +# GARDEN_DEPLOY_ACTION: minecluster-proxy + +# jobs: +# deploy-edge: +# steps: +# # Setup Oasis +# - name: Oasis Setup +# uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto +# with: +# deploy-env: edge +# infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} +# # Deploy to Edge Cluster +# - name: Deploy to Edge Cluster +# run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge +# working-directory: ${{ env.OASIS_WORKSPACE }} +# # Alert via Discord +# - name: Discord Alert +# if: always() +# uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status +# with: +# status: ${{ job.status }} +# channel: deployments +# header: DEPLOY EDGE +# additional-content: "Minecluster Proxy" \ No newline at end of file diff --git a/.gitea/workflows/deploy-edge.yml b/.forgejo/workflows/deploy-edge.yml similarity index 52% rename from .gitea/workflows/deploy-edge.yml rename to .forgejo/workflows/deploy-edge.yml index 9748db7..afb0c78 100644 --- a/.gitea/workflows/deploy-edge.yml +++ b/.forgejo/workflows/deploy-edge.yml @@ -1,8 +1,8 @@ name: Deploy USW-MC -run-name: ${{ gitea.actor }} Deploy USW-MC +run-name: ${{ forgejo.actor }} Deploy USW-MC on: - push: - branches: [ master ] + push: + branches: [master] env: GARDEN_DEPLOY_ACTION: minecluster @@ -10,34 +10,35 @@ env: jobs: deploy-edge: steps: - # Configure proper kubeconfig + # Configure proper kubeconfig (Used when cluster does not match the edge environment) - name: Get usw-mc deployment kubeconfig - uses: https://gitea.dunemask.dev/elysium/elysium-actions@infisical-env + uses: https://forgejo.dunemask.dev/elysium/elysium-actions@infisical-env with: infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} + project-id: ${{ vars.INFISICAL_DEPLOYMENTS_PROJECT_ID }} secret-envs: edge - secret-paths: /kubernetes + secret-paths: /kubernetes/usw-mc # Setup Oasis - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto + uses: https://forgejo.dunemask.dev/elysium/elysium-actions@oasis-setup-auto with: deploy-env: edge infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} - extra-secret-paths: /alexandria + infisical-project: ${{ vars.INFISICAL_DEPLOYMENTS_PROJECT_ID }} + extra-secret-paths: /dashboard extra-secret-envs: edge - kubeconfig: ${{ env.KUBERNETES_CONFIG_USW_MC }} # Deploy to Edge - name: Deploy to Edge env - run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-mc + run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge working-directory: ${{ env.OASIS_WORKSPACE }} - env: - MCL_KUBECONFIG: ${{ env.KUBERNETES_CONFIG_USW_MC }} + env: # (Used when cluster does not match the edge environment) + MCL_KUBECONFIG: ${{ env.KUBERNETES_CONFIG_USW_MC }} # Alert via Discord - name: Discord Alert if: always() - uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status + uses: https://forgejo.dunemask.dev/elysium/elysium-actions@discord-status with: status: ${{ job.status }} channel: deployments header: DEPLOY MC - additional-content: "Minecluster Server Manager Deployment" \ No newline at end of file + additional-content: "Minecluster Server Manager Deployment" diff --git a/.forgejo/workflows/qa-api-tests.yml b/.forgejo/workflows/qa-api-tests.yml new file mode 100644 index 0000000..596e11a --- /dev/null +++ b/.forgejo/workflows/qa-api-tests.yml @@ -0,0 +1,42 @@ +# name: QA API Tests +# run-name: ${{ gitea.actor }} QA API Test +# on: +# pull_request: +# branches: [ master ] + +# env: +# REPO_DIR: ${{ gitea.workspace }}/minecluster +# GARDEN_LINK_ACTION: build.minecluster-image + +# jobs: +# qa-api-tests: +# steps: +# # Setup Oasis +# - name: Oasis Setup +# uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto +# with: +# deploy-env: ci +# infisical-token: ${{ secrets.INFISICAL_ELYSIUM_CI_READ_TOKEN }} +# # Test Code +# - name: Checkout repository +# uses: actions/checkout@v3 +# with: +# path: ${{ env.REPO_DIR }} +# # Garden link +# - name: Link Repo code to Garden +# run: garden link action $GARDEN_LINK_ACTION $REPO_DIR --env usw-ci --var cubit-projects=cairo,minecluster +# working-directory: ${{ env.OASIS_WORKSPACE }} +# # Cubit CI Tests +# - name: Run Cubit tests in CI env +# run: garden workflow qa-api-tests --env usw-ci --var ci-ttl=25m +# working-directory: ${{ env.OASIS_WORKSPACE }} +# # Discord Alert +# - name: Discord Alert +# if: always() +# uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status +# with: +# status: ${{ job.status }} +# channel: ci +# header: QA API Tests +# additional-content: "CI Namespace: `${{env.CI_NAMESPACE}}`" + \ No newline at end of file diff --git a/.forgejo/workflows/s3-repo-backup.yml b/.forgejo/workflows/s3-repo-backup.yml new file mode 100644 index 0000000..4e4e7fd --- /dev/null +++ b/.forgejo/workflows/s3-repo-backup.yml @@ -0,0 +1,17 @@ +name: S3 Repo Backup +run-name: ${{ forgejo.actor }} S3 Repo Backup +on: + push: + branches: [ master ] + +jobs: + s3-repo-backup: + steps: + - name: S3 Backup + uses: https://forgejo.dunemask.dev/elysium/elysium-actions@s3-backup + with: + infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} + infisical-project: ${{ vars.INFISICAL_DEPLOYMENTS_PROJECT_ID }} + - name: Status Alert + if: always() + run: echo "The Job ended with status ${{ job.status }}." diff --git a/.gitea/workflows/deploy-edge-proxy.yml b/.gitea/workflows/deploy-edge-proxy.yml deleted file mode 100644 index c961b21..0000000 --- a/.gitea/workflows/deploy-edge-proxy.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Deploy Edge Proxy -run-name: ${{ gitea.actor }} Deploy Edge Proxy -on: - push: - branches: [ master ] - -env: - GARDEN_DEPLOY_ACTION: minecluster-proxy - -jobs: - deploy-edge: - steps: - # Setup Oasis - - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto - with: - deploy-env: edge - infisical-token: ${{ secrets.INFISICAL_ELYSIUM_EDGE_READ_TOKEN }} - # Deploy to Edge Cluster - - name: Deploy to Edge Cluster - run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge - working-directory: ${{ env.OASIS_WORKSPACE }} - # Alert via Discord - - name: Discord Alert - if: always() - uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status - with: - status: ${{ job.status }} - channel: deployments - header: DEPLOY EDGE - additional-content: "Minecluster Proxy" \ No newline at end of file diff --git a/.gitea/workflows/qa-api-tests.yml b/.gitea/workflows/qa-api-tests.yml deleted file mode 100644 index 8222cdf..0000000 --- a/.gitea/workflows/qa-api-tests.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: QA API Tests -run-name: ${{ gitea.actor }} QA API Test -on: - pull_request: - branches: [ master ] - -env: - REPO_DIR: ${{ gitea.workspace }}/minecluster - GARDEN_LINK_ACTION: build.minecluster-image - -jobs: - qa-api-tests: - steps: - # Setup Oasis - - name: Oasis Setup - uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-auto - with: - deploy-env: ci - infisical-token: ${{ secrets.INFISICAL_ELYSIUM_CI_READ_TOKEN }} - # Test Code - - name: Checkout repository - uses: actions/checkout@v3 - with: - path: ${{ env.REPO_DIR }} - # Garden link - - name: Link Repo code to Garden - run: garden link action $GARDEN_LINK_ACTION $REPO_DIR --env usw-ci --var cubit-projects=cairo,minecluster - working-directory: ${{ env.OASIS_WORKSPACE }} - # Cubit CI Tests - - name: Run Cubit tests in CI env - run: garden workflow qa-api-tests --env usw-ci --var ci-ttl=25m - working-directory: ${{ env.OASIS_WORKSPACE }} - # Discord Alert - - name: Discord Alert - if: always() - uses: https://gitea.dunemask.dev/elysium/elysium-actions@discord-status - with: - status: ${{ job.status }} - channel: ci - header: QA API Tests - additional-content: "CI Namespace: `${{env.CI_NAMESPACE}}`" - \ No newline at end of file diff --git a/.gitea/workflows/s3-repo-backup.yml b/.gitea/workflows/s3-repo-backup.yml deleted file mode 100644 index 77b0702..0000000 --- a/.gitea/workflows/s3-repo-backup.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: S3 Repo Backup -run-name: ${{ gitea.actor }} S3 Repo Backup -on: - push: - branches: [ master ] - -env: - S3_BACKUP_ENDPOINT: https://s3.dunemask.dev - S3_BACKUP_KEY_ID: gitea-repo-backup - S3_BACKUP_KEY: ${{ secrets.S3_REPO_BACKUP_KEY }} - REPO_DIR: ${{ gitea.workspace }}/${{ gitea.respository }} -jobs: - s3-repo-backup: - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - path: ${{ env.REPO_DIR }} - - name: S3 Backup - uses: peter-evans/s3-backup@v1 - env: - ACCESS_KEY_ID: ${{ env.S3_BACKUP_KEY_ID }} - SECRET_ACCESS_KEY: ${{ env.S3_BACKUP_KEY }} - MIRROR_SOURCE: ${{ env.REPO_DIR }} - MIRROR_TARGET: backups/gitea-repositories/${{ gitea.repository }} - STORAGE_SERVICE_URL: ${{env.S3_BACKUP_ENDPOINT}} - with: - args: --overwrite --remove - - name: Status Alert - if: always() - run: echo "The Job ended with status ${{ job.status }}." diff --git a/.gitignore b/.gitignore index 867d829..5c86a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ -build -dist +.env diff --git a/.helmignore b/.helmignore index 1532758..f4ac0f7 100644 --- a/.helmignore +++ b/.helmignore @@ -2,5 +2,3 @@ node_modules/ .git/ lib/ src/ -dist/ -build/ diff --git a/Dockerfile b/Dockerfile index 86d3c6d..c578d05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,15 +4,13 @@ WORKDIR /dunemask/net/minecluster COPY package.json . COPY package-lock.json . RUN npm i -# Copy build resources over +# Copy react build resources over COPY public public COPY dist dist COPY src src -COPY lib lib -# Copy TSConfigs over COPY index.html . -COPY vite.config.ts . -COPY tsconfig.json . -COPY tsconfig.server.json . -RUN npm run package:full +COPY vite.config.js . +RUN npm run build:react +# Copy Backend resources over +COPY lib lib CMD ["npm","start"] diff --git a/dist/app.js b/dist/app.js new file mode 100644 index 0000000..d87897e --- /dev/null +++ b/dist/app.js @@ -0,0 +1,11 @@ +import k8s from "@kubernetes/client-node"; +import Minecluster from "../lib/Minecluster.js"; +const mcl = new Minecluster(); +mcl.start(); + +async function main(){ +const kc = new k8s.KubeConfig(); +kc.loadFromDefault(); +} + +main().catch((e)=>{console.error(e)}); diff --git a/index.html b/index.html index 683a35a..4fadd4e 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,6 @@
- +