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

Rebuild axosyslog image with auto patch version increment #411

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mitzkia
Copy link
Contributor

@mitzkia mitzkia commented Dec 6, 2024

After this PR when we request a new stable image job the axosyslog patch version will increment automatically

@mitzkia mitzkia marked this pull request as draft December 6, 2024 14:00
requirements.txt Outdated Show resolved Hide resolved
@mitzkia mitzkia force-pushed the axosyslog_image_rebuild branch from 2762970 to c6c4a45 Compare December 6, 2024 14:32
@mitzkia
Copy link
Contributor Author

mitzkia commented Dec 6, 2024

I would like to provide a test job run (from my fork) here (AxoSyslog stable image), but until now it fails every time on image build.

update:
it seems works :) :
https://github.com/mitzkia/axosyslog/actions/runs/12154279030/job/33894119353

@mitzkia mitzkia marked this pull request as ready for review December 6, 2024 14:57
- id: docker-metadata-tags
name: Extract metadata (AxoSyslog version) for Docker
run: |
last_full_version=$(skopeo inspect docker://ghcr.io/axoflow/axosyslog:latest | jq '.RepoTags' | sed 's/ \|"\|,//g' | grep "^[0-9]*.[0-9]*.[0-9]*$\|^[0-9]*.[0-9]*.[0-9]*-[0-9]*$" | tail -n 1)
Copy link
Member

Choose a reason for hiding this comment

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

The summary of the patch contains everything twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review notice, fixed.

Andras Mitzki added 2 commits December 9, 2024 11:27
- query the latest released version
- create new patch version or increment latest patch version

Signed-off-by: Andras Mitzki <[email protected]>
- this is for automatically update python libraries

Signed-off-by: Andras Mitzki <[email protected]>
@mitzkia mitzkia force-pushed the axosyslog_image_rebuild branch from c6c4a45 to ab1ede8 Compare December 9, 2024 10:27
- id: docker-metadata-tags
name: Extract metadata (AxoSyslog version) for Docker
run: |
last_full_version=$(skopeo inspect docker://ghcr.io/axoflow/axosyslog:latest | jq '.RepoTags' | sed 's/ \|"\|,//g' | grep "^[0-9]*.[0-9]*.[0-9]*$\|^[0-9]*.[0-9]*.[0-9]*-[0-9]*$" | tail -n 1)
Copy link
Member

@MrAnno MrAnno Dec 10, 2024

Choose a reason for hiding this comment

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

I think this won't work properly if we want to do a new AxoSyslog release: 4.9.0 -> 4.10.0

When doing a stable release, this job is usually executed on a git tag.
I think it would be the safest and cleanest to extract the X.Y.Z version information always from the git tag, and optionally, from an input parameter when we are forced to do a rebuild from a custom branch (that won't happen often).
docker/metadata-action@v5 is a good tool to get such git tag information.

When we want to calculate the container-rebuild-version R (X.Y.Z-R), we can do what you did: check the previous container tag (but let's be strict: check if the last container tag's X.Y.Z prefix matches the git tag information we extracted from docker/metadata-action@v5 or from the input parameter), and increment R by one.

When doing a new AxoSyslog release 4.9.0 -> 4.10.0, the X.Y.Z prefix won't match, in that case we should start from 1: 4.10.0-1.

@mitzkia mitzkia force-pushed the axosyslog_image_rebuild branch from 9ec7b0c to ff36c55 Compare December 11, 2024 11:49
Signed-off-by: Andras Mitzki <[email protected]>
@mitzkia mitzkia marked this pull request as draft December 13, 2024 12:28
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