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

Updating version_variables that follow tag_format #846

Open
fk128 opened this issue Feb 23, 2024 · 1 comment
Open

Updating version_variables that follow tag_format #846

fk128 opened this issue Feb 23, 2024 · 1 comment
Assignees
Labels

Comments

@fk128
Copy link

fk128 commented Feb 23, 2024

Hi,

Is it possible to update mentions of the version in files set in version_variables that follow tag_format?

I'm using kustomize for deployments on kubernetes, and I want to be able to update the docker image tag on release. The issue is that, in the yaml file, the tag uses the v prefix, as defined in tag_format.

For instance, the following does not work to update the yaml file because semantic release is not looking for the tag_format pattern

[tool.semantic_release]
tag_format = "v{version}"
version_variables = ["api/app/__init__.py:__version__",
    "manifests/overlays/prod/kustomization.yaml:newTag"]
# kustomization.yaml
images:
  - name: repo/image
    newTag: "v0.1.0"

It only seems to work to get semantic release to update the yaml file if I remove the v prefix, like so

# kustomization.yaml
images:
  - name: repo/image
    newTag: "0.1.0"

but then that wouldn't work, since the actual docker image tag has v as per tag_format.

Is this something that could be solved, perhaps by getting the version replacement to also look for tag_format?

Thanks.

@fk128 fk128 added the question label Feb 23, 2024
@codejedi365
Copy link
Contributor

codejedi365 commented Feb 26, 2024

@fk128 , your question has been received. I will have to run some tests to find a solution for you.

@codejedi365 codejedi365 self-assigned this Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants