diff --git a/.github/workflows/Umbrella_Sandbox_Setup.yml b/.github/workflows/Umbrella_Sandbox_Setup.yml new file mode 100644 index 000000000..c2fd4f85c --- /dev/null +++ b/.github/workflows/Umbrella_Sandbox_Setup.yml @@ -0,0 +1,107 @@ +############################################################### +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +############################################################### + +name: Umbrella Sandbox Setup + +on: + #for testing purpouses + pull_request: + branches: + - 'main' + push: + branches: + - 'main' + workflow_dispatch: + +jobs: + setup-sandbox: + runs-on: ubuntu-latest + env: + NODE_IMAGE: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }} + HELM_VERSION: ${{ github.event.inputs.helm_version || 'latest' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Kubernetes KinD Cluster + uses: container-tools/kind-action@0ad70e2299366b0e1552c7240f4e4567148f723e + with: + version: v0.20.0 + node_image: ${{ env.NODE_IMAGE }} + + - name: Enable Ingress in KinD + run: | + kubectl apply -f https://kind.sigs.k8s.io/examples/ingress/deploy-ingress-nginx.yaml + kubectl wait --namespace ingress-nginx \ + --for=condition=ready pod \ + --selector=app.kubernetes.io/component=controller \ + --timeout=90s + + - name: Verify Cluster + run: | + kubectl cluster-info + kubectl get nodes -o wide + + - name: Set up Helm + uses: azure/setup-helm@v4.1.0 + with: + version: ${{ env.HELM_VERSION }} + + - name: Build portal frontend + uses: docker/build-push-action@v4.1.0 + with: + context: . + file: ./.conf/Dockerfile.full + push: true + tags: kind-registry:5000/portal-frontend:testing + + - name: Add Tractus-X Helm Repository + run: | + helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev + helm repo update + + - name: Install Umbrella Chart Portal Subset + run: | + helm install \ + --set portal.enabled=true,centralidp.enabled=true,sharedidp.enabled=true umbrella tractusx-dev/umbrella \ + --set portal.frontend.image.repository=kind-registry:5000/portal-frontend --set portal.frontend.image.tag=testing \ + --namespace umbrella --create-namespace + + - name: Verify Deployment + run: | + kubectl get pods -n umbrella + helm ls --namespace umbrella + + - name: Install Node.js for Cypress + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install Cypress Dependencies + run: | + npm install cypress --legacy-peer-deps + + - name: Cleanup Resources + if: always() + run: | + helm uninstall umbrella --namespace umbrella || true + kubectl delete namespace umbrella || true + kind delete cluster || true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4563b8379..aa2b2d974 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,28 +107,3 @@ jobs: password: ${{ secrets.DOCKER_HUB_TOKEN }} repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} readme-filepath: '.conf/docker-notice-portal.md' - - auth-and-dispatch: - needs: build-and-push-image - runs-on: ubuntu-latest - - steps: - - name: Get token - id: get_workflow_token - uses: peter-murray/workflow-application-token-action@8e4e6fbf6fcc8a272781d97597969d21b3812974 # v4.0.0 - with: - application_id: ${{ secrets.ORG_PORTAL_DISPATCH_APPID }} - application_private_key: ${{ secrets.ORG_PORTAL_DISPATCH_KEY }} - - - name: Trigger workflow - id: call_action - env: - TOKEN: ${{ steps.get_workflow_token.outputs.token }} - run: | - curl -v \ - --request POST \ - --url https://api.github.com/repos/eclipse-tractusx/portal/actions/workflows/portal-image-update.yml/dispatches \ - --header "authorization: Bearer $TOKEN" \ - --header "Accept: application/vnd.github.v3+json" \ - --data '{"ref":"main", "inputs": { "new-image":"${{ github.sha }}" }}' \ - --fail