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 initial support for SOURCE_DATE_EPOCH #175

Conversation

DannyBrito
Copy link
Contributor

@DannyBrito DannyBrito commented Mar 14, 2024

What this PR does / why we need it:
Adds initial support for SOURCE_DATE_EPOCH, technically this variable was already able to be injected in Dalec specs as one of the requirements to add this is to explicit require the args/envs. It seems like SOURCE_DATE_EPOCH env var is auto injected by docker/buildx so no need to explicit --build-arg. The difference I could notice is that now with change applied the build will not fail as unknow arg for SOURCE_DATE_EPOCH var but it still requires the spec to set this variable to be used.

# syntax=ghcr.io/azure/dalec/frontend:latest
args:
  SOURCE_DATE_EPOCH: # [Required] Needs to explicit call for variable to be usable within spec

name: go-md2man
version: 2.0.3
packager: Dalec Example
...
sources:
...
build:
  env:
    SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH} # [Required] Needs to explicit set variable to be usable within build scope
  steps:
    - command: |
        set -x
        echo "${SOURCE_DATE_EPOCH} # If any of the required fields is missing value will be empty.
        exit 1

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #54

Special notes for your reviewer:

@DannyBrito DannyBrito requested a review from a team as a code owner March 14, 2024 15:39
Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit ff2f58a into Azure:main Mar 15, 2024
9 checks passed
@cpuguy83 cpuguy83 added this to the v0.2.0 milestone Mar 15, 2024
@DannyBrito DannyBrito deleted the dannybrito/add-initial-support-source-date-epoch branch March 28, 2024 14:15
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.

Support SOURCE_DATE_EPOCH passthrough
2 participants