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

Fix macos only chart update cmd #15

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

TSnowden-1311
Copy link
Contributor

The makefile sed cmd to update Chart.yaml only worked on macos.. (sed -i ""...)

Slightly changed direction.. I've taken the version value from a file created from the split manifest.. We have no need to check for "latest" in that sense.

Added a target due to some makefile conformity.. Resulting version update to the Charts.yaml file has dbl quotes in the value.

@TSnowden-1311
Copy link
Contributor Author

/cc @msvticket

Copy link
Member

@msvticket msvticket left a comment

Choose a reason for hiding this comment

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

Added a target due to some makefile conformity.

What do you mean by this?

Makefile Outdated

fetch: prep
# Set value in Chart.yaml
yq eval -i '.appVersion = "$(shell yq eval '.data.version | sub("v"; "")' ${CHART_DIR}/templates/dashboard-info-cm.yaml)"' ${CHART_DIR}/Chart.yaml
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be cleaner

Suggested change
yq eval -i '.appVersion = "$(shell yq eval '.data.version | sub("v"; "")' ${CHART_DIR}/templates/dashboard-info-cm.yaml)"' ${CHART_DIR}/Chart.yaml
yq -i '.appVersion = (load("$(CHART_DIR)/templates/dashboard-info-cm.yaml").data.version | sub("v"; ""))' Chart.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Marten.. I tried a few ways of updating Chart.yaml with nested conditionals (to decipher the OS) inside the existing ifneq. That pushed me to change direction and add the new target with a dependency.

Thanks for the suggestion - your cmd actually works as part of the original target "fetch".. I have reverted some of the code and kept your version of the yq cmd.

Pushing again - cheers!

@msvticket msvticket merged commit 1f29c1c into jenkins-x:main Oct 28, 2024
1 check passed
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