Skip to content

Commit a7898e4

Browse files
Fix
1 parent 65552d4 commit a7898e4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/scripts/azure_app_verify_and_publish.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ echo "6. Running CPA verification (cpa verify)..."
8888
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$(pwd)":/data mcr.microsoft.com/container-package-app:latest cpa verify --directory /data
8989
echo "CPA verification complete."
9090

91-
# 7. Run CPA buildbundle within the container
92-
echo "7. Building the CPA bundle (cpa buildbundle)..."
91+
# 7. Login to ACR and build CPA bundle
92+
echo "7a. Logging into Azure Container Registry..."
93+
echo "${AZURE_ACR_PASSWORD}" | docker login "${AZURE_ACR_REGISTRY}" --username "${AZURE_ACR_USERNAME}" --password-stdin
94+
95+
echo "7b. Building the CPA bundle (cpa buildbundle)..."
9396
# This creates the .cnab directory and the bundle file (e.g., sonarqube.cnab)
9497
# in the current directory (mounted as /data in container).
95-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$(pwd)":/data mcr.microsoft.com/container-package-app:latest sh -c "echo "${AZURE_ACR_PASSWORD}" | docker login "${AZURE_ACR_REGISTRY}" --username "${AZURE_ACR_USERNAME}" --password-stdin && cd /data && cpa buildbundle --force"
98+
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$(pwd)":/data mcr.microsoft.com/container-package-app:latest cpa buildbundle --force
9699
echo "CPA bundle built successfully."
97100
echo "CPA bundle pushed to ACR successfully!"
98101

0 commit comments

Comments
 (0)