From 626c80b0f528f394f783844244a98e5892262587 Mon Sep 17 00:00:00 2001 From: Shubhada Date: Fri, 4 Oct 2024 13:46:16 -0700 Subject: [PATCH] Replaced the whole run-rp with docker compose --- .pipelines/templates/template-acr-push.yml | 22 ++++++--- Makefile | 55 +--------------------- 2 files changed, 17 insertions(+), 60 deletions(-) diff --git a/.pipelines/templates/template-acr-push.yml b/.pipelines/templates/template-acr-push.yml index 265d7fb51be..8a37d3bdd97 100644 --- a/.pipelines/templates/template-acr-push.yml +++ b/.pipelines/templates/template-acr-push.yml @@ -48,17 +48,25 @@ steps: echo "Listing Docker images..." docker images - # Check if the image is already tagged with the full repository path + # Define both the full repository image name and the local name IMAGE_NAME="${ACR_FQDN}/${{ parameters.repository }}:$(VERSION)" LOCAL_IMAGE="${{ parameters.repository }}:$(VERSION)" - echo "Checking for image $LOCAL_IMAGE..." - if [[ "$(docker images -q $LOCAL_IMAGE 2> /dev/null)" == "" ]]; then - echo "Error: Image $LOCAL_IMAGE not found. Exiting." - exit 1 + # Check if the image exists locally with the full repository tag + echo "Checking for image $IMAGE_NAME..." + if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then + # If the full repository tagged image does not exist, check for the local image + echo "Full repository image not found. Checking for local image $LOCAL_IMAGE..." + if [[ "$(docker images -q $LOCAL_IMAGE 2> /dev/null)" == "" ]]; then + echo "Error: Neither $IMAGE_NAME nor $LOCAL_IMAGE found. Exiting." + exit 1 + else + # Retag the local image with the full repository path + echo "Local image $LOCAL_IMAGE found. Retagging with full repository path..." + docker tag $LOCAL_IMAGE $IMAGE_NAME + fi else - echo "Image found. Retagging with full repository path..." - docker tag $LOCAL_IMAGE $IMAGE_NAME + echo "Image $IMAGE_NAME found. Proceeding to push..." fi # Ensure the image is available locally before tagging 'latest' diff --git a/Makefile b/Makefile index 7f1af9ec2a5..771c06174d2 100644 --- a/Makefile +++ b/Makefile @@ -480,59 +480,8 @@ run-portal: ci-rp podman-secrets # run-rp executes the RP locally as similarly as possible to production. That # includes the use of Hive, meaning you need a VPN connection. .PHONY: run-rp -run-rp: ci-rp podman-secrets - podman $(PODMAN_REMOTE_ARGS) \ - run \ - --name aro-rp \ - --rm \ - -p 127.0.0.1:8443:8443 \ - -w /app \ - -e ARO_IMAGE \ - -e RP_MODE="development" \ - -e PROXY_HOSTNAME \ - -e DOMAIN_NAME \ - -e AZURE_RP_CLIENT_ID \ - -e AZURE_FP_CLIENT_ID \ - -e AZURE_SUBSCRIPTION_ID \ - -e AZURE_TENANT_ID \ - -e AZURE_RP_CLIENT_SECRET \ - -e LOCATION \ - -e RESOURCEGROUP \ - -e AZURE_ARM_CLIENT_ID \ - -e AZURE_FP_SERVICE_PRINCIPAL_ID \ - -e AZURE_DBTOKEN_CLIENT_ID \ - -e AZURE_PORTAL_CLIENT_ID \ - -e AZURE_PORTAL_ACCESS_GROUP_IDS \ - -e AZURE_CLIENT_ID \ - -e AZURE_SERVICE_PRINCIPAL_ID \ - -e AZURE_CLIENT_SECRET \ - -e AZURE_GATEWAY_CLIENT_ID \ - -e AZURE_GATEWAY_SERVICE_PRINCIPAL_ID \ - -e AZURE_GATEWAY_CLIENT_SECRET \ - -e DATABASE_NAME \ - -e PULL_SECRET \ - -e SECRET_SA_ACCOUNT_NAME \ - -e DATABASE_ACCOUNT_NAME \ - -e KEYVAULT_PREFIX \ - -e ADMIN_OBJECT_ID \ - -e PARENT_DOMAIN_NAME \ - -e PARENT_DOMAIN_RESOURCEGROUP \ - -e AZURE_ENVIRONMENT \ - -e STORAGE_ACCOUNT_DOMAIN \ - -e OIDC_STORAGE_ACCOUNT_NAME \ - -e KUBECONFIG="/app/secrets/aks.kubeconfig" \ - -e HIVE_KUBE_CONFIG_PATH="/app/secrets/aks.kubeconfig" \ - -e ARO_CHECKOUT_PATH="/app" \ - -e ARO_INSTALL_VIA_HIVE="true" \ - -e ARO_ADOPT_BY_HIVE="true" \ - -e MOCK_MSI_TENANT_ID \ - -e MOCK_MSI_CLIENT_ID \ - -e MOCK_MSI_CERT \ - --secret aks.kubeconfig,target=/app/secrets/aks.kubeconfig \ - --secret proxy-client.key,target=/app/secrets/proxy-client.key \ - --secret proxy-client.crt,target=/app/secrets/proxy-client.crt \ - --secret proxy.crt,target=/app/secrets/proxy.crt \ - $(LOCAL_ARO_RP_IMAGE):$(VERSION) rp + docker compose rm -sf rp + docker compose up rp .PHONY: vpn vpn: