-
Notifications
You must be signed in to change notification settings - Fork 49
feat: Creating a GitHub actions workflow which spins up the Umbrella #1484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
599c2be
a9a4086
0dbc057
23cae34
506b850
955fbe8
38dfb03
c5be070
6223efd
9956573
8d36e6d
fe2a4e5
10d7021
288e518
80ea40a
781e4fd
df62fe0
2cdfbc2
784c5c5
8e496ba
3f9785f
739d66f
4296e75
59d49e6
4e591d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove comment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove comment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove comment |
||||||||||||||
| pull_request: | ||||||||||||||
| branches: | ||||||||||||||
| - 'main' | ||||||||||||||
|
Comment on lines
+25
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should restrict the triggering of the workflow to only when really needed (it runs about 6 minutes or longer and otherwise just waste resources)
Suggested change
|
||||||||||||||
| push: | ||||||||||||||
| branches: | ||||||||||||||
| - 'main' | ||||||||||||||
|
Comment on lines
+27
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should restrict the triggering of the workflow to only when really needed (it runs about 6 minutes or longer and otherwise just waste resources)
Suggested change
|
||||||||||||||
| 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/[email protected] | ||||||||||||||
| with: | ||||||||||||||
| version: ${{ env.HELM_VERSION }} | ||||||||||||||
|
|
||||||||||||||
| - name: Build portal frontend | ||||||||||||||
| uses: docker/[email protected] | ||||||||||||||
| 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 | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add this, otherwise we try to start testing and the keycloak realms and/or the portal db migrations are not ready yet
Suggested change
|
||||||||||||||
| - 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 | ||||||||||||||
|
Comment on lines
+98
to
+100
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is ready to execute the cypress tests yet, right? could you please have a look at the cypress docs to gh actions As I mentioned in the last portal sync, I assume that all the addresses in umbrella for portal, centralidp and sharedidp will be needed to be overwritten to the k8s cluster internal services, example, because the ingress isn't enabled with the gh actions k8s cluster. |
||||||||||||||
| - name: Cleanup Resources | ||||||||||||||
| if: always() | ||||||||||||||
| run: | | ||||||||||||||
| helm uninstall umbrella --namespace umbrella || true | ||||||||||||||
| kubectl delete namespace umbrella || true | ||||||||||||||
| kind delete cluster || true | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,28 +107,3 @@ jobs: | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
| repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} | ||
| readme-filepath: '.conf/docker-notice-portal.md' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please undo changes to build.yml |
||
|
|
||
| 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 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also rename file to e2e-tests.yml