Skip to content

fix: ACR build and push script failing - #692

Open
Priyanka2-Microsoft wants to merge 1 commit into
devfrom
fix-acr-build-push-script-failing
Open

fix: ACR build and push script failing#692
Priyanka2-Microsoft wants to merge 1 commit into
devfrom
fix-acr-build-push-script-failing

Conversation

@Priyanka2-Microsoft

@Priyanka2-Microsoft Priyanka2-Microsoft commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Purpose

  • ...
    This pull request refactors and improves the Azure Container Registry (ACR) build and push scripts for both PowerShell and Bash, and updates the .dockerignore file for ContentProcessorWeb. The main goals are to ensure only tracked source files are included in Docker build contexts, improve cross-platform compatibility, and streamline the handling of temporary build directories.

Build context handling and script improvements:

  • Refactored both acr_build_push.ps1 and acr_build_push.sh scripts to create a temporary staging directory for each image build, copying only files tracked by Git (using git ls-files). This ensures that only relevant, version-controlled files are included in the Docker build context, reducing image size and avoiding accidental inclusion of local or untracked files. [1] [2]
  • Updated path handling in PowerShell to use .Path property for consistency and cross-platform compatibility.
  • Improved cleanup logic to ensure temporary build directories are always removed after the build, even if the build fails. [1] [2]
  • Standardized the use of Join-Path and string interpolation for file paths in the PowerShell script, improving readability and maintainability.

.dockerignore updates for ContentProcessorWeb:

  • Cleaned up comments and added explicit root-level exclusions for common build artifacts and caches (node_modules, build, coverage, .cache, .parcel-cache, .pnpm-store, .pnpm-cache, .pnpm). This aligns with the new build context logic and prevents unnecessary files from being included in Docker images. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the ACR remote build/push automation for Bash and PowerShell by staging a temporary Docker build context (intended to limit what gets sent to ACR), and updates ContentProcessorWeb’s .dockerignore to better exclude common local artifacts from build contexts.

Changes:

  • Refactors acr_build_push.sh to stage a temporary build context directory per image before running az acr build.
  • Refactors acr_build_push.ps1 similarly, improving path handling and ensuring staging cleanup via try/finally.
  • Updates src/ContentProcessorWeb/.dockerignore with additional exclusions and comment cleanup.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/ContentProcessorWeb/.dockerignore Adds additional ignore patterns intended to keep common frontend/build artifacts out of ACR build contexts.
infra/scripts/acr_build_push.sh Introduces staging-directory build contexts for ACR builds and related refactoring.
infra/scripts/acr_build_push.ps1 Introduces staging-directory build contexts for ACR builds, with improved path handling and cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread infra/scripts/acr_build_push.sh
Comment thread infra/scripts/acr_build_push.sh
Comment thread infra/scripts/acr_build_push.ps1
Comment thread src/ContentProcessorWeb/.dockerignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants