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

Merged
merged 5 commits into from
Dec 10, 2024

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 40.97%. Comparing base (74f1f9f) to head (f1572fe).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6742      +/-   ##
==========================================
- Coverage   40.98%   40.97%   -0.02%     
==========================================
  Files        2079     2079              
  Lines      183922   183922              
==========================================
- Hits        75389    75366      -23     
- Misses     102232   102253      +21     
- Partials     6301     6303       +2     
Flag Coverage Δ
unittests 40.97% <ø> (-0.02%) ⬇️

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.

@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 16:10 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 16:20 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 16:30 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 20:20 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown temporarily deployed to Production Docker Registry November 20, 2024 20:21 — with GitHub Actions Inactive
@sjonpaulbrown sjonpaulbrown force-pushed the jp/support-private-registry branch from 9846741 to 58c8ab8 Compare November 20, 2024 23:51
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 23:58 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 20, 2024 23:58 — with GitHub Actions Failure
@sjonpaulbrown sjonpaulbrown force-pushed the jp/support-private-registry branch from 58c8ab8 to 2ba50ed Compare November 21, 2024 00:04
@sjonpaulbrown sjonpaulbrown temporarily deployed to Production Docker Registry November 21, 2024 00:16 — with GitHub Actions Inactive
@sjonpaulbrown sjonpaulbrown temporarily deployed to Production Docker Registry November 21, 2024 00:22 — with GitHub Actions Inactive
@sjonpaulbrown sjonpaulbrown had a problem deploying to Production Docker Registry November 21, 2024 00:22 — with GitHub Actions Error
@sjonpaulbrown sjonpaulbrown marked this pull request as ready for review November 21, 2024 00:32
@sjonpaulbrown sjonpaulbrown added this pull request to the merge queue Dec 2, 2024
@sjonpaulbrown sjonpaulbrown removed this pull request from the merge queue due to a manual request Dec 2, 2024
@sjonpaulbrown sjonpaulbrown added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
@sjonpaulbrown sjonpaulbrown added this pull request to the merge queue Dec 10, 2024
Merged via the queue into master with commit 0310dfd Dec 10, 2024
55 checks passed
@sjonpaulbrown sjonpaulbrown deleted the jp/support-private-registry branch December 10, 2024 22:16
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