From 621921d6894ad2ca3483da87f1282006fa2e3fbe Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Mon, 28 Oct 2024 15:31:15 +0100 Subject: [PATCH] deploy frontend Signed-off-by: Gerd Oberlechner --- .github/workflows/aro-hcp-dev-env-cd.yml | 86 +++++++++++------------- Makefile | 2 +- dev-infrastructure/Makefile | 4 +- tooling/image-sync/Makefile | 2 +- 4 files changed, 42 insertions(+), 52 deletions(-) diff --git a/.github/workflows/aro-hcp-dev-env-cd.yml b/.github/workflows/aro-hcp-dev-env-cd.yml index 59a8971ed..0103663ee 100644 --- a/.github/workflows/aro-hcp-dev-env-cd.yml +++ b/.github/workflows/aro-hcp-dev-env-cd.yml @@ -315,55 +315,46 @@ cd tooling/image-sync make push - # deploy_to_service_cluster: - # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - # needs: - # - build_push_frontend - # - build_push_backend - # - build_push_imagesync - # - build_push_ocmirror - # - deploy_service_cluster_rg - # permissions: - # id-token: 'write' - # contents: 'read' - # runs-on: 'ubuntu-latest' - # outputs: - # service_cluster_name: ${{ steps.find_service_cluster.name }} - # env: - # RESOURCEGROUP: aro-hcp-dev-westus3-sc - # steps: - # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - # with: - # fetch-depth: 1 + deploy_to_service_cluster: + #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + needs: + - build_push_frontend + - build_push_backend + - build_push_imagesync + - build_push_ocmirror + - deploy_service_cluster_rg + permissions: + id-token: 'write' + contents: 'read' + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + with: + fetch-depth: 1 - # - name: 'Az CLI login' - # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - # with: - # client-id: ${{ secrets.AZURE_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: 'Az CLI login' + uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - # - name: 'Find service cluster' - # id: find_service_cluster - # uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0 - # with: - # azcliversion: 2.63.0 - # inlineScript: | - # echo "name=$(az aks list --resource-group "${SC_RESOURCEGROUP}" --output tsv --query "[?tags.clusterType == 'svc-cluster'].name | [0]")" >> $GITHUB_OUTPUT + - name: Install Azure CLI + uses: ./.github/actions/install-azure-cli - # - uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0 + - uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0 - # # Used to deploy Cluster Service - # - name: 'Install oc' - # run: | - # curl -sfLo - https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.15.9/openshift-client-linux.tar.gz | tar xzf - - # sudo mv oc /usr/local/bin/oc - # chmod +x /usr/local/bin/oc + # Used to deploy Cluster Service + - name: 'Install oc' + run: | + curl -sfLo - https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.15.9/openshift-client-linux.tar.gz | tar xzf - + sudo mv oc /usr/local/bin/oc + chmod +x /usr/local/bin/oc - # # Used to deploy Maestro Server, Frontend - # - uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 - # with: - # version: 'v3.13.3' + # Used to deploy Maestro Server, Frontend + - uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 + with: + version: 'v3.13.3' # - uses: azure/use-kubelogin@76597ae0fcbaace21b05e13a2cbf8daee2c6e820 # v1.2 # with: @@ -381,10 +372,9 @@ # cd istio # make deploy-service - # - name: 'Deploy Frontend' - # run: | - # cd frontend/ - # make deploy + - name: 'Deploy Frontend' + run: | + make rp.frontend.deploy # - name: 'Deploy Backend' # run: | diff --git a/Makefile b/Makefile index c62cde924..613708ac7 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ maestro.agent.deploy: ./svc-deploy.sh $(DEPLOY_ENV) maestro/agent mgmt maestro.registration.deploy: - ./svc-deploy.sh $(DEPLOY_ENV) maestro/registration mgmt + ./svc-deploy.sh $(DEPLOY_ENV) maestro/registration svc maestro: maestro.server.deploy maestro.agent.deploy maestro.registration.deploy diff --git a/dev-infrastructure/Makefile b/dev-infrastructure/Makefile index 7bfe42d99..dfee865ce 100644 --- a/dev-infrastructure/Makefile +++ b/dev-infrastructure/Makefile @@ -236,10 +236,10 @@ svc.what-if: svc.rg .PHONY: svc.what-if svc.dev-role-assignments: - @./ensure-no-running-deployment.sh $(SC_RESOURCEGROUP) svc-roleassigns + @./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) svc-roleassigns az deployment group create \ --name svc-roleassigns \ - --resource-group "${SC_RESOURCEGROUP}" \ + --resource-group "${SVC_RESOURCEGROUP}" \ --template-file templates/dev-roleassignments.bicep \ --parameters configurations/dev-role-assignments.bicepparam --parameters principalID=${PRINCIPAL_ID} diff --git a/tooling/image-sync/Makefile b/tooling/image-sync/Makefile index f76178bc1..1fb7a5252 100644 --- a/tooling/image-sync/Makefile +++ b/tooling/image-sync/Makefile @@ -1,6 +1,6 @@ SHELL = /bin/bash DEPLOY_ENV ?= personal-dev -$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) +$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) include config.mk COMMIT = $(shell git rev-parse --short=7 HEAD)$(shell [[ $$(git status --porcelain) = "" ]] || echo -dirty)