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

Update Docker hub Workflow With Reusable actions #233

Merged
merged 5 commits into from
Jul 15, 2024
Merged

Conversation

SaikrishnaBairamoni
Copy link
Contributor

@SaikrishnaBairamoni SaikrishnaBairamoni commented Jul 12, 2024

This PR updates the Docker Hub workflow to use reusable actions from usdotfhwastol/actions repository and for consistent Docker image building and pushing.

PR Details

Description

Related GitHub Issue

Related Jira Key

Motivation and Context

How Has This Been Tested?

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

.github/workflows/dockerhub.yml Show resolved Hide resolved
id: docker-image-metadata
run: |
echo build_date=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) >> $GITHUB_OUTPUT
echo vcs_ref=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this vcs_ref mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This git commit reference we are capturing it from actions repo usually contains a short reference to the specific git commit https://github.com/usdot-fhwa-stol/actions/blob/main/docker-build-metadata/action.yml

tags: usdotfhwastoldev/telematic_cloud_messaging:${{ github.ref_name }}
tags: usdotfhwastolcandidate/telematic_cloud_messaging:${{ github.ref_name }}
build-args: |
BUILD_DATE=${{ steps.docker-image-metadata.outputs.build_date }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

How are these build args used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as we are passing then during the docker build time process we can see the metadata details in the docker image layers once we build is finished so that the Docker hub image has metadata about when it was built, the commit it was built from.

@dan-du-car dan-du-car merged commit 8eacb18 into develop Jul 15, 2024
16 checks passed
@dan-du-car dan-du-car deleted the fix_docker_tags branch July 15, 2024 12:40
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.

3 participants