diff --git a/.github/workflows/ephemeral.yml b/.github/workflows/ephemeral.yml index 8c74548..acfd123 100644 --- a/.github/workflows/ephemeral.yml +++ b/.github/workflows/ephemeral.yml @@ -4,273 +4,17 @@ on: pull_request: types: [opened, synchronize, reopened, closed] -env: - REGISTRY: registry.fullstack.pw - IMAGE_NAME: library/cks-frontend - VAULT_ADDR: https://vault.fullstack.pw - permissions: contents: write pull-requests: write jobs: - manage-environment: - runs-on: self-hosted - outputs: - dns_name: ${{ steps.cluster-info.outputs.dns_name }} - cluster_name: ${{ steps.cluster-info.outputs.cluster_name }} - deployment_status: ${{ steps.deployment-status.outputs.status }} - steps: - - name: Set cluster info - id: cluster-info - run: | - CLUSTER_NAME="pr-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}" - DNS_NAME="pr-${{ github.event.pull_request.number }}-${{ github.event.repository.name }}.ephemeral.fullstack.pw" - echo "cluster_name=$CLUSTER_NAME" >> $GITHUB_OUTPUT - echo "dns_name=$DNS_NAME" >> $GITHUB_OUTPUT - - - name: Checkout app code - if: github.event.action != 'closed' - uses: actions/checkout@v4 - - - name: Checkout infra repo - uses: actions/checkout@v4 - with: - repository: fullstack-pw/infra - token: ${{ secrets.RUNNER }} - path: infra - - - name: Check if cluster exists - id: check-cluster - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - if kubectl get cluster "$CLUSTER_NAME" -n "$CLUSTER_NAME" --context tools --kubeconfig /home/runner/.kube/config &>/dev/null; then - echo "exists=true" >> $GITHUB_OUTPUT - echo "Cluster $CLUSTER_NAME already exists" - else - echo "exists=false" >> $GITHUB_OUTPUT - echo "Cluster $CLUSTER_NAME does not exist" - fi - - # ==================== CREATE/UPDATE ENVIRONMENT ==================== - - name: Check IP pool capacity - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - cd infra - AVAILABLE=$(./clusters/scripts/ip_pool_manager.sh check-capacity) - CAPACITY_RESULT=$? - echo "Capacity available: $AVAILABLE slots free" - if [ "$CAPACITY_RESULT" -ne 0 ]; then - echo "::error::IP pool exhausted. All 5 ephemeral cluster slots are in use (10 IPs / 2 per cluster). Please close old PRs." - exit 1 - fi - - - name: Allocate IP from pool - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - id: allocate - run: | - cd infra - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - CLUSTER_IP=$(./clusters/scripts/ip_pool_manager.sh allocate "$CLUSTER_NAME") - - # Calculate node IP (VIP + 1) - each cluster needs 2 IPs - IP_LAST_OCTET=$(echo "$CLUSTER_IP" | cut -d'.' -f4) - NODE_IP_LAST_OCTET=$((IP_LAST_OCTET + 1)) - NODE_IP="192.168.1.${NODE_IP_LAST_OCTET}" - - echo "ip=$CLUSTER_IP" >> $GITHUB_OUTPUT - echo "node_ip=$NODE_IP" >> $GITHUB_OUTPUT - echo "Allocated control plane VIP: $CLUSTER_IP" - echo "Node IP: $NODE_IP" - - - name: Render Cluster API manifest - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - cd infra - export CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - export CLUSTER_IP="${{ steps.allocate.outputs.ip }}" - export NODE_IP="${{ steps.allocate.outputs.node_ip }}" - export PR_NUMBER="${{ github.event.pull_request.number }}" - export REPOSITORY="${{ github.event.repository.name }}" - envsubst < ephemeral-clusters/cluster-api/k3s-cluster.yaml.tpl > /tmp/cluster.yaml - cat /tmp/cluster.yaml - - - name: Create cluster via Cluster API - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - kubectl apply -f /tmp/cluster.yaml --context tools --kubeconfig /home/runner/.kube/config - - - name: Copy Proxmox credentials to namespace - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - kubectl --context tools --kubeconfig /home/runner/.kube/config \ - get secret proxmox-credentials -n k3s-test -o json | \ - jq 'del(.metadata.namespace,.metadata.uid,.metadata.resourceVersion,.metadata.creationTimestamp,.metadata.ownerReferences,.metadata.finalizers)' | \ - kubectl --context tools --kubeconfig /home/runner/.kube/config apply -n "$CLUSTER_NAME" -f - || \ - echo "Warning: Could not copy proxmox-credentials (may already exist)" - - - name: Wait for cluster available - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - echo "Waiting for cluster $CLUSTER_NAME to be available..." - kubectl wait --for=condition=Available \ - cluster/$CLUSTER_NAME \ - -n $CLUSTER_NAME \ - --timeout=5m --context tools --kubeconfig /home/runner/.kube/config - - - name: Extract kubeconfig - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - kubectl get secret ${CLUSTER_NAME}-kubeconfig \ - -n $CLUSTER_NAME \ - -o jsonpath='{.data.value}' --context tools --kubeconfig /home/runner/.kube/config | base64 -d > /tmp/kubeconfig - - # Rename context to match workspace name for OpenTofu - ORIGINAL_CONTEXT=$(kubectl --kubeconfig /tmp/kubeconfig config current-context) - kubectl --kubeconfig /tmp/kubeconfig config rename-context "$ORIGINAL_CONTEXT" "$CLUSTER_NAME" - kubectl --kubeconfig /tmp/kubeconfig config use-context "$CLUSTER_NAME" - - - name: Apply ephemeral infrastructure with OpenTofu - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - env: - KUBECONFIG: /tmp/kubeconfig - run: | - cd infra - make ephemeral-init - make ephemeral-apply WORKSPACE=${{ steps.cluster-info.outputs.cluster_name }} MINIMAL=true - - # ==================== BUILD AND DEPLOY (PR opened/updated) ==================== - - name: Build and push Docker image - id: build - if: github.event.action != 'closed' - run: | - IMAGE_TAG="pr-${{ github.event.pull_request.number }}-${{ github.sha }}" - docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG} . - echo "${HARBOR_KEY}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin - docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG} - echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT - - - name: Extract kubeconfig - if: github.event.action != 'closed' - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - kubectl get secret ${CLUSTER_NAME}-kubeconfig \ - -n $CLUSTER_NAME \ - -o jsonpath='{.data.value}' --context tools --kubeconfig /home/runner/.kube/config | base64 -d > /tmp/kubeconfig - - # Rename context to match workspace name for OpenTofu - ORIGINAL_CONTEXT=$(kubectl --kubeconfig /tmp/kubeconfig config current-context) - kubectl --kubeconfig /tmp/kubeconfig config rename-context "$ORIGINAL_CONTEXT" "$CLUSTER_NAME" - kubectl --kubeconfig /tmp/kubeconfig config use-context "$CLUSTER_NAME" - - - name: Deploy to ephemeral cluster - if: github.event.action != 'closed' - env: - KUBECONFIG: /tmp/kubeconfig - run: | - DNS_NAME="${{ steps.cluster-info.outputs.dns_name }}" - IMAGE_TAG="${{ steps.build.outputs.image_tag }}" - - # Render manifests with updated image tag and DNS hostname - kubectl kustomize kustomize/overlays/ephemeral \ - | sed "s|${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-will-be-replaced|${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}|" \ - | sed "s|dev.cks.fullstack.pw|${DNS_NAME}|g" \ - | kubectl apply -f - - - # Wait for deployment rollout - kubectl rollout status deployment/cks-frontend \ - -n default --timeout=5m - - - name: Set deployment status - id: deployment-status - if: github.event.action != 'closed' - run: echo "status=success" >> $GITHUB_OUTPUT - - - name: Post deployment info - if: github.event.action != 'closed' && steps.check-cluster.outputs.exists == 'false' - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const dnsName = '${{ steps.cluster-info.outputs.dns_name }}'; - const clusterName = '${{ steps.cluster-info.outputs.cluster_name }}'; - const imageTag = '${{ steps.build.outputs.image_tag }}'; - - const body = `## Ephemeral Environment Ready - - Your ephemeral environment has been deployed! - - **URL**: https://${dnsName} - **Cluster**: \`${clusterName}\` - **Image**: \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${imageTag}\` - - The environment will be automatically destroyed when this PR is closed. - `; - - github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: body - }); - - # ==================== CLEANUP ==================== - - name: Get kubeconfig for destruction - if: github.event.action == 'closed' || (failure() && steps.check-cluster.outputs.exists == 'false') - run: | - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - kubectl get secret ${CLUSTER_NAME}-kubeconfig \ - -n $CLUSTER_NAME \ - -o jsonpath='{.data.value}' --context tools --kubeconfig /home/runner/.kube/config | base64 -d > /tmp/kubeconfig || true - - # Rename context to match workspace name for OpenTofu - if [ -f /tmp/kubeconfig ]; then - ORIGINAL_CONTEXT=$(kubectl --kubeconfig /tmp/kubeconfig config current-context 2>/dev/null || echo "") - if [ -n "$ORIGINAL_CONTEXT" ]; then - kubectl --kubeconfig /tmp/kubeconfig config rename-context "$ORIGINAL_CONTEXT" "$CLUSTER_NAME" 2>/dev/null || true - kubectl --kubeconfig /tmp/kubeconfig config use-context "$CLUSTER_NAME" 2>/dev/null || true - fi - fi - - - name: Destroy ephemeral infrastructure - if: github.event.action == 'closed' || (failure() && steps.check-cluster.outputs.exists == 'false') - env: - KUBECONFIG: /tmp/kubeconfig - run: | - cd infra - CLUSTER_NAME="${{ steps.cluster-info.outputs.cluster_name }}" - - make ephemeral-init - make ephemeral-destroy WORKSPACE=${{ steps.cluster-info.outputs.cluster_name }} || true - - kubectl delete cluster "$CLUSTER_NAME" -n "$CLUSTER_NAME" --context tools --kubeconfig /home/runner/.kube/config || true - - ./clusters/scripts/ip_pool_manager.sh release "$CLUSTER_NAME" || true - - cypress-tests: - needs: manage-environment - if: github.event.action != 'closed' && needs.manage-environment.outputs.deployment_status == 'success' - runs-on: self-hosted - container: - image: cypress/included:13.6.4 - steps: - - name: Checkout demo-apps repository - uses: actions/checkout@v4 - with: - repository: fullstack-pw/demo-apps - path: . - - - name: Run Cypress tests - id: cypress - continue-on-error: true - uses: cypress-io/github-action@v6 - with: - spec: cypress/e2e/cks-frontend.cy.js - config: baseUrl=https://${{ needs.manage-environment.outputs.dns_name }} - env: CKS_FRONTEND_URL=https://${{ needs.manage-environment.outputs.dns_name }},TEST_ENV=ephemeral - browser: chrome - install-command: npm ci - summary-title: Cypress Test Results + ephemeral: + uses: homelabz-eu/pipelines/.github/workflows/ephemeral-environment.yml@main + with: + image-name: library/cks-frontend + dev-hostname-placeholder: dev.cks.homelabz.eu + deployment-name: cks-frontend + cypress-spec: cypress/e2e/cks-frontend.cy.js + cypress-env-key: CKS_FRONTEND_URL + secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/manual-pipeline.yml b/.github/workflows/manual-pipeline.yml index c296e4a..ad89148 100644 --- a/.github/workflows/manual-pipeline.yml +++ b/.github/workflows/manual-pipeline.yml @@ -34,7 +34,7 @@ jobs: needs: [determine-app] if: needs.determine-app.outputs.apps != '[]' name: Build and Push - uses: fullstack-pw/pipelines/.github/workflows/build-and-push.yml@main + uses: homelabz-eu/pipelines/.github/workflows/build-and-push.yml@main with: app-context: "." app-name: "cks-frontend" @@ -44,7 +44,7 @@ jobs: needs: [determine-app, docker-build-and-push] if: needs.determine-app.outputs.apps != '[]' && contains(github.event.inputs.deploy_target, 'dev') name: DEV deploy ${{ matrix.app.app_name }} - uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main with: kustomize-dir: "./kustomize/overlays/dev" context: "dev" @@ -54,14 +54,14 @@ jobs: # needs: dev-deploy # if: github.event.inputs.run_tests == 'true' && contains(github.event.inputs.deploy_target, 'dev') # name: DEV cypress - # uses: fullstack-pw/pipelines/.github/workflows/cypress.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/cypress.yml@main # with: # start: npm run cypress:dev # env-vars: | # { - # "ENQUEUER_URL": "https://dev.enqueuer.fullstack.pw", - # "WRITER_URL": "https://dev.writer.fullstack.pw", - # "MEMORIZER_URL": "https://dev.memorizer.fullstack.pw", + # "ENQUEUER_URL": "https://dev.enqueuer.homelabz.eu", + # "WRITER_URL": "https://dev.writer.homelabz.eu", + # "MEMORIZER_URL": "https://dev.memorizer.homelabz.eu", # "ENVIRONMENT": "dev", # "TEST_RETRIES": "2" # } @@ -70,7 +70,7 @@ jobs: needs: [determine-app, docker-build-and-push] if: needs.determine-app.outputs.apps != '[]' && contains(github.event.inputs.deploy_target, 'stg') name: STG deploy ${{ matrix.app.app_name }} - uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main with: kustomize-dir: "./kustomize/overlays/stg" context: "stg" @@ -80,14 +80,14 @@ jobs: # needs: stg-deploy # if: github.event.inputs.run_tests == 'true' && contains(github.event.inputs.deploy_target, 'stg') # name: STG cypress - # uses: fullstack-pw/pipelines/.github/workflows/cypress.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/cypress.yml@main # with: # start: npm run cypress:stg # env-vars: | # { - # "ENQUEUER_URL": "https://stg.enqueuer.fullstack.pw", - # "WRITER_URL": "https://stg.writer.fullstack.pw", - # "MEMORIZER_URL": "https://stg.memorizer.fullstack.pw", + # "ENQUEUER_URL": "https://stg.enqueuer.homelabz.eu", + # "WRITER_URL": "https://stg.writer.homelabz.eu", + # "MEMORIZER_URL": "https://stg.memorizer.homelabz.eu", # "ENVIRONMENT": "stg", # "TEST_RETRIES": "2" # } @@ -96,7 +96,7 @@ jobs: needs: [determine-app, docker-build-and-push] if: needs.determine-app.outputs.apps != '[]' && contains(github.event.inputs.deploy_target, 'prod') name: PROD deploy ${{ matrix.app.app_name }} - uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main with: kustomize-dir: "./kustomize/overlays/prod" context: "prod" diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0c78944..759ed19 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -20,7 +20,7 @@ permissions: jobs: docker-build-and-push: name: Build and Push - uses: fullstack-pw/pipelines/.github/workflows/build-and-push.yml@main + uses: homelabz-eu/pipelines/.github/workflows/build-and-push.yml@main with: app-context: "." app-name: "cks-frontend" @@ -61,7 +61,7 @@ jobs: # dev-deploy: # needs: [docker-build-and-push] # name: DEV deploy - # uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main # with: # kustomize-dir: "./kustomize/overlays/dev" # context: "dev" @@ -70,12 +70,12 @@ jobs: # dev-cypress-tests: # needs: dev-deploy # name: DEV cypress - # uses: fullstack-pw/pipelines/.github/workflows/cypress.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/cypress.yml@main # with: # start: npm run cypress:dev # env-vars: | # { - # "ENQUEUER_URL": "https://dev.enqueuer.fullstack.pw", + # "ENQUEUER_URL": "https://dev.enqueuer.homelabz.eu", # "ENVIRONMENT": "dev", # "TEST_RETRIES": "2" # } @@ -83,7 +83,7 @@ jobs: # stg-deploy: # # needs: [dev-cypress-tests] # name: STG deploy - # uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main # with: # kustomize-dir: "./${{ matrix.app.app_path }}/kustomize/overlays/stg" # context: "stg" @@ -92,14 +92,14 @@ jobs: # stg-cypress-tests: # needs: stg-deploy # name: STG cypress - # uses: fullstack-pw/pipelines/.github/workflows/cypress.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/cypress.yml@main # with: # start: npm run cypress:stg # env-vars: | # { - # "ENQUEUER_URL": "https://stg.enqueuer.fullstack.pw", - # "WRITER_URL": "https://stg.writer.fullstack.pw", - # "MEMORIZER_URL": "https://stg.memorizer.fullstack.pw", + # "ENQUEUER_URL": "https://stg.enqueuer.homelabz.eu", + # "WRITER_URL": "https://stg.writer.homelabz.eu", + # "MEMORIZER_URL": "https://stg.memorizer.homelabz.eu", # "ENVIRONMENT": "stg", # "TEST_RETRIES": "2" # } @@ -108,7 +108,7 @@ jobs: # # needs: [stg-cypress-tests] # if: github.event_name == 'push' && github.ref == 'refs/heads/main' # name: PROD deploy - # uses: fullstack-pw/pipelines/.github/workflows/deploy-kustomize.yml@main + # uses: homelabz-eu/pipelines/.github/workflows/deploy-kustomize.yml@main # with: # kustomize-dir: "./${{ matrix.app.app_path }}/kustomize/overlays/prod" # context: "prod" diff --git a/Makefile b/Makefile index 151e286..3300efa 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # Variables APP_NAME = cks-frontend VERSION ?= latest -REGISTRY ?= registry.fullstack.pw +REGISTRY ?= registry.toolz.homelabz.eu IMAGE = $(REGISTRY)/$(APP_NAME):$(VERSION) NAMESPACE ?= cks-system @@ -30,7 +30,7 @@ build: ## Build Docker image --label "org.opencontainers.image.created=$(BUILD_DATE)" \ --label "org.opencontainers.image.revision=$(GIT_COMMIT)" \ --label "org.opencontainers.image.version=$(VERSION)" \ - --label "org.opencontainers.image.source=https://github.com/fullstack-pw/cks-frontend" \ + --label "org.opencontainers.image.source=https://github.com/homelabz-eu/cks-frontend" \ . .PHONY: push diff --git a/README.md b/README.md index 0d1fa6f..da37f69 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ CMD ["node", "server.js"] **Automated Pipeline** (`.github/workflows/pipeline.yml`) Job Flow: -1. **docker-build-and-push**: Multi-stage build, push to `registry.fullstack.pw/library/cks-frontend:latest` and commit SHA +1. **docker-build-and-push**: Multi-stage build, push to `registry.toolz.homelabz.eu/library/cks-frontend:latest` and commit SHA 2. **dev-deploy**: Kustomize overlay application to development cluster 3. **versioning**: Semantic versioning from commit messages, GitHub release creation @@ -125,7 +125,7 @@ Job Flow: ```yaml containers: - name: cks-frontend - image: registry.fullstack.pw/library/cks-frontend:latest + image: registry.toolz.homelabz.eu/library/cks-frontend:latest ports: - containerPort: 3000 envFrom: @@ -160,7 +160,7 @@ containers: ```yaml spec: hosts: - - dev.cks.fullstack.pw # Overridden per environment + - dev.cks.homelabz.eu # Overridden per environment gateways: - istio-system/default-gateway http: @@ -209,7 +209,7 @@ useSWR(key, fetcher, { ### Terminal Architecture -Terminal access is delegated to [cks-terminal-mgmt](https://github.com/fullstack-pw/cks-terminal-mgmt), a dedicated microservice running on the sandboxy cluster. +Terminal access is delegated to [cks-terminal-mgmt](https://github.com/homelabz-eu/cks-terminal-mgmt), a dedicated microservice running on the sandboxy cluster. **Flow**: ``` @@ -466,7 +466,7 @@ const handleDelete = async (sessionId) => { - Custom hooks (5 specialized hooks) **Terminal**: -- iframe-based rendering via [cks-terminal-mgmt](https://github.com/fullstack-pw/cks-terminal-mgmt) (ttyd) +- iframe-based rendering via [cks-terminal-mgmt](https://github.com/homelabz-eu/cks-terminal-mgmt) (ttyd) **Content & Utilities**: - react-markdown 8.0 (Markdown rendering) @@ -495,9 +495,9 @@ Key configuration via ConfigMap: | `LOG_LEVEL` | Logging verbosity | `DEBUG` | **Environment-Specific Values**: -- **dev**: `https://dev.api.cks.fullstack.pw/api/v1` -- **stg**: `https://stg.api.cks.fullstack.pw/api/v1` -- **prod**: `https://api.cks.fullstack.pw/api/v1` +- **dev**: `https://dev.api.cks.homelabz.eu/api/v1` +- **stg**: `https://stg.api.cks.homelabz.eu/api/v1` +- **prod**: `https://api.cks.homelabz.eu/api/v1` ## Repository Structure @@ -598,4 +598,4 @@ cks-frontend/ **Version**: 1.0.0 **License**: Proprietary -**Repository**: https://github.com/fullstack-pw/cks-frontend +**Repository**: https://github.com/homelabz-eu/cks-frontend diff --git a/kustomize/base/analysis-template.yaml b/kustomize/base/analysis-template.yaml index ddf23a6..d368023 100644 --- a/kustomize/base/analysis-template.yaml +++ b/kustomize/base/analysis-template.yaml @@ -31,7 +31,7 @@ spec: # Clone the demo-apps repository apt-get update -o Acquire::AllowInsecureRepositories=true || true apt-get install -y git --allow-unauthenticated - git clone https://github.com/fullstack-pw/demo-apps.git /demo-apps + git clone https://github.com/homelabz-eu/demo-apps.git /demo-apps cd /demo-apps # Install dependencies diff --git a/kustomize/base/deployment.yaml b/kustomize/base/deployment.yaml index dce063b..9f83f13 100644 --- a/kustomize/base/deployment.yaml +++ b/kustomize/base/deployment.yaml @@ -14,10 +14,10 @@ spec: spec: containers: - name: cks-frontend - image: registry.fullstack.pw/library/cks-frontend:latest + image: registry.toolz.homelabz.eu/library/cks-frontend:latest envFrom: - - configMapRef: - name: cks-frontend-config + - configMapRef: + name: cks-frontend-config ports: - containerPort: 3000 protocol: TCP diff --git a/kustomize/base/promotion-template.yaml b/kustomize/base/promotion-template.yaml index 1833960..6f22daf 100644 --- a/kustomize/base/promotion-template.yaml +++ b/kustomize/base/promotion-template.yaml @@ -29,18 +29,18 @@ spec: # Configure git git config --global user.name "Argo Rollouts Auto-Promotion" - git config --global user.email "noreply@fullstack.pw" + git config --global user.email "noreply@homelabz.eu" # Clone cks-frontend repository - git clone https://github.com/fullstack-pw/cks-frontend.git /workspace + git clone https://github.com/homelabz-eu/cks-frontend.git /workspace cd /workspace # Get the current dev version (the version that just passed tests) DEV_KUSTOMIZATION="kustomize/overlays/dev/kustomization.yaml" PROD_KUSTOMIZATION="kustomize/overlays/prod/kustomization.yaml" - DEV_TAG=$(grep -A1 "name: registry.fullstack.pw/library/{{args.app-name}}" "$DEV_KUSTOMIZATION" | grep "newTag:" | awk '{print $2}') - PROD_TAG=$(grep -A1 "name: registry.fullstack.pw/library/{{args.app-name}}" "$PROD_KUSTOMIZATION" | grep "newTag:" | awk '{print $2}') + DEV_TAG=$(grep -A1 "name: registry.toolz.homelabz.eu/library/{{args.app-name}}" "$DEV_KUSTOMIZATION" | grep "newTag:" | awk '{print $2}') + PROD_TAG=$(grep -A1 "name: registry.toolz.homelabz.eu/library/{{args.app-name}}" "$PROD_KUSTOMIZATION" | grep "newTag:" | awk '{print $2}') echo "Dev is at version: $DEV_TAG" echo "Prod is at version: $PROD_TAG" @@ -61,7 +61,7 @@ spec: git commit -m "chore({{args.app-name}}): auto-promote $DEV_TAG to prod [skip ci]" # Push using GitHub token - git push https://${GITHUB_TOKEN}@github.com/fullstack-pw/cks-frontend.git main + git push https://${GITHUB_TOKEN}@github.com/homelabz-eu/cks-frontend.git main echo "Successfully promoted {{args.app-name}} to production" exit 0 diff --git a/kustomize/base/rollout.yaml b/kustomize/base/rollout.yaml index 88c41ad..72dec00 100644 --- a/kustomize/base/rollout.yaml +++ b/kustomize/base/rollout.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: cks-frontend - image: registry.fullstack.pw/library/cks-frontend:latest + image: registry.toolz.homelabz.eu/library/cks-frontend:latest envFrom: - configMapRef: name: cks-frontend-config @@ -53,7 +53,7 @@ spec: - name: app-name value: cks-frontend - name: app-url - value: "https://dev.cks.fullstack.pw" + value: "https://dev.cks.homelabz.eu" - name: environment value: "dev" postPromotionAnalysis: diff --git a/kustomize/base/virtualservice.yaml b/kustomize/base/virtualservice.yaml index b5a8a29..63b63f6 100644 --- a/kustomize/base/virtualservice.yaml +++ b/kustomize/base/virtualservice.yaml @@ -6,7 +6,7 @@ metadata: cert-manager.io/cluster-issuer: letsencrypt-prod spec: hosts: - - "dev.cks.fullstack.pw" # Will be overridden in overlays + - "dev.cks.homelabz.eu" # Will be overridden in overlays gateways: - istio-system/default-gateway http: diff --git a/kustomize/ephemeral-base/deployment.yaml b/kustomize/ephemeral-base/deployment.yaml index dce063b..161030d 100644 --- a/kustomize/ephemeral-base/deployment.yaml +++ b/kustomize/ephemeral-base/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: cks-frontend - image: registry.fullstack.pw/library/cks-frontend:latest + image: registry.toolz.homelabz.eu/library/cks-frontend:latest envFrom: - configMapRef: name: cks-frontend-config diff --git a/kustomize/overlays/dev/kustomization.yaml b/kustomize/overlays/dev/kustomization.yaml index d1e1c35..39ebeb8 100644 --- a/kustomize/overlays/dev/kustomization.yaml +++ b/kustomize/overlays/dev/kustomization.yaml @@ -5,7 +5,7 @@ resources: - ../../base images: - - name: registry.fullstack.pw/library/cks-frontend + - name: registry.toolz.homelabz.eu/library/cks-frontend newTag: f8bcc38ba974638c844b1d79ed085f2099bb0e54 configMapGenerator: diff --git a/kustomize/overlays/ephemeral/kustomization.yaml b/kustomize/overlays/ephemeral/kustomization.yaml index 334331e..8447300 100644 --- a/kustomize/overlays/ephemeral/kustomization.yaml +++ b/kustomize/overlays/ephemeral/kustomization.yaml @@ -7,20 +7,20 @@ resources: - ../../ephemeral-base images: - - name: registry.fullstack.pw/library/cks-frontend + - name: registry.toolz.homelabz.eu/library/cks-frontend newTag: pr-will-be-replaced patches: - patch: |- - op: replace path: /metadata/annotations/external-dns.alpha.kubernetes.io~1hostname - value: "dev.cks.fullstack.pw" + value: "dev.cks.homelabz.eu" - op: replace path: /spec/tls/0/hosts/0 - value: "dev.cks.fullstack.pw" + value: "dev.cks.homelabz.eu" - op: replace path: /spec/rules/0/host - value: "dev.cks.fullstack.pw" + value: "dev.cks.homelabz.eu" target: kind: Ingress name: cks-frontend diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index f961c2e..dddab7d 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -5,14 +5,14 @@ resources: - ../../base images: - - name: registry.fullstack.pw/library/cks-frontend + - name: registry.toolz.homelabz.eu/library/cks-frontend newTag: f8bcc38ba974638c844b1d79ed085f2099bb0e54 patches: - patch: |- - op: replace path: /spec/hosts/0 - value: "cks.fullstack.pw" + value: "cks.homelabz.eu" target: kind: VirtualService name: cks-frontend diff --git a/src/.env.local b/src/.env.local index 02becdf..e4a85c2 100644 --- a/src/.env.local +++ b/src/.env.local @@ -1,4 +1,4 @@ # Backend API URL for your K8s environment -API_BASE_URL=https://dev.api.cks.fullstack.pw/api/v1 +API_BASE_URL=https://dev.api.cks.homelabz.eu/api/v1 NEXT_TELEMETRY_DISABLED=1 \ No newline at end of file diff --git a/src/components/Layout.js b/src/components/Layout.js index e82f25b..134c16f 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -60,7 +60,7 @@ const Layout = ({ children, title = 'CKS', hideHeader = false }) => {