Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for private registry builds #6742

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sjonpaulbrown
Copy link
Collaborator

@sjonpaulbrown sjonpaulbrown commented Nov 19, 2024

Add Support for Private Registry Builds

This PR introduces support for building and pushing Docker images to a private registry. The changes include:

  1. New Input private_build:

    • A new boolean input parameter private_build has been added to the workflow.
    • This parameter enables users to specify whether images should be built and pushed to a private Docker registry.
  2. Enhanced Google Cloud Authentication:

    • Updated gcloud auth configure-docker logic to conditionally authenticate with the private registry (us-central1-docker.pkg.dev) when private_build is set to true. Defaults to public registry otherwise.
  3. Container Registry Variable Setup:

    • Added a dedicated step to determine and set the CONTAINER_REGISTRY environment variable.
    • Dynamically chooses between PRIVATE_REGISTRY and PUBLIC_REGISTRY based on the value of the private_build input.
  4. Build/Push Commands:

    • Updated all make commands to reference the CONTAINER_REGISTRY environment variable.
    • Ensures all Docker build/push commands target the correct registry.
  5. Improved Workflow Modularity:

    • Extracted container registry logic into a separate step to improve clarity and reusability across build steps.

Use Case:

This enhancement is designed to support scenarios where private Docker image builds are required, such as deploying hotfixes or managing private image distributions. It maintains compatibility with existing public registry workflows while adding flexibility for private builds.

Example Workflow Executions

@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.24%. Comparing base (ed149a7) to head (9825c34).
Report is 82 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6742      +/-   ##
==========================================
+ Coverage   41.19%   41.24%   +0.04%     
==========================================
  Files        2052     2054       +2     
  Lines      182215   182368     +153     
==========================================
+ Hits        75069    75209     +140     
- Misses     100852   100861       +9     
- Partials     6294     6298       +4     
Flag Coverage Δ
unittests 41.24% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@sjonpaulbrown sjonpaulbrown temporarily deployed to Production Docker Registry November 21, 2024 00:16 — with GitHub Actions Inactive
@sjonpaulbrown sjonpaulbrown deployed to Production Docker Registry November 21, 2024 00:22 — with GitHub Actions Active
@sjonpaulbrown sjonpaulbrown marked this pull request as ready for review November 21, 2024 00:32
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.

4 participants