martialblog/docker-limesurvey

Latest Images are not pushed in GH Actions

martialblog opened this issue · 12 comments

Looks like the Tags without the Full Version are not build since the move from DockerHub. 🤦

martialblog/limesurvey                             5-apache        fe8a33f2dd74   5 months ago    665MB
martialblog/limesurvey                             3-apache        4cb5c1807d79   5 months ago    651MB

@jacksgt Einmal mit Profis arbeiten...

Maybe semver is not the right type? 5.2.2-211115

          tags: |
            type=semver,pattern={{raw}},suffix=-apache
            type=semver,pattern={{major}},suffix=-apache

Might be that pep440 or match is what we want.

I'll build some Images and push them, just so that everything is up2date

That's strange 👀

Okay, here's my quick analysis:

Due to the fact that the tags have a suffix (-22111), the semver parsing logic detects these as a semver pre-release versions.
As described in the metadata-action docs, pre-releases are always evaluated as {{version}}:

Pre-release (rc, beta, alpha) will only extend {{version}} as tag because they are updated frequently, and contain many breaking changes that are (by the author's design) not yet fit for public consumption.

Thus, the metadata actions returns x.y.z-NNNN for both {{version}} and {{major}}. :-(

See the relevant code here:
https://github.com/docker/metadata-action/blob/5220b231121b5b69d5effbe0d0e4770a68500a44/src/meta.ts#L145

The pep440 type has the same limitation.

I think type=match is the best option. How much work that versioning schema has cost me over the years...

If we can get the Tag as a variable, we could do some variable substitution and pass into value=

type=semver,pattern={{version}},value=${STRANGE_VERSION_SCHEMA%pattern}

Might just be simpler to use type=match to get the major version

type=match,pattern=(^\d),group=0

@jacksgt you got any idea on how to develop/test/debug GitHub Actions? Would be nice to test stuff on the old localhost

I am not aware of a way to debug them locally. But you can just disable the steps after "docker-metadata" such that the image won't be build and pushed.

Might just be simpler to use type=match to get the major version

type=match,pattern=(^\d),group=0

Indeed, good suggestion - it works!

        "tags": [
          "docker.io/***/limesurvey:0.0.0-test1-apache",
          "docker.io/***/limesurvey:0-apache"
        ],

Just pushed some new tags, worked like a charm 👍

Great! :-)