platform-plugin-dev-docker icon indicating copy to clipboard operation
platform-plugin-dev-docker copied to clipboard

feat: auto-update shopware versions in `build-docker-images.yaml`

Open cngJo opened this issue 3 years ago • 1 comments

Please describe the feature you would like to see implemented.

As mentioned in https://github.com/FriendsOfShopware/platform-plugin-dev-docker/pull/13#issuecomment-1226112573 the process of adding new shopware versions could be automated.

I guess the easiest way would be to:

  • setup a scheduled GH-Action that:
    • fetches the latest release from github.com/shopware/platform
    • compares the minor versions against the matrix configuration
    • adds the minor version tag of the found release to the matrix configuration if there is a newer release
    • creates a pull request against master

All that should be possible with GH-Actions running JavaScript code and the GitHub API. If you'd be willing to accept that (or a different suggested approach), I'd be willing to put time into this and figure that out.

cngJo avatar Aug 24 '22 20:08 cngJo

Thank you for taking the initiative, that sounds like a good plan.

I once already started a similar thing, but never finished it, or published it. As I have very little time at the moment, I would be grateful if you work on it.

You probably already know that, but the tags can be obtained as you suggested via the Github API, e.g.

curl -X GET https://api.github.com/repos/shopware/platform/git/refs/tags -o shopware-tags.json

Another thing I was thinking about is that we do not really need to store the matrix, but could generate it dynamically using a job in the GH actions, as for example seen here: https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/#new-fromjson-method-in-expressions

echo "::set-output name=matrix::<encoded-matrix-json>"

Than we run these jobs regularly. The problem there might be that we would like to detect if we really need to rebuild the image or not (to not rebuild the image every night).

But feel free to choose whatever approach you prefer :-) if it works, I will merge it :-D

aragon999 avatar Aug 24 '22 21:08 aragon999