Skip to content

Commit

Permalink
Replaced the whole run-rp with docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhadapaithankar committed Oct 4, 2024
1 parent 701d5c9 commit 626c80b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 60 deletions.
22 changes: 15 additions & 7 deletions .pipelines/templates/template-acr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
55 changes: 2 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 626c80b

Please sign in to comment.