RotherOSS / otobo

OTOBO is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. https://otobo.io/
GNU General Public License v3.0
262 stars 75 forks source link

Build the release Docker image on Github #3673

Open bschmalhofer opened 3 months ago

bschmalhofer commented 3 months ago

Building of the devel Docker images seems to work. The next step is to also build the release images. This could be done in a separate workflow. Code duplication can maybe avoided by using reusable workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows . Originally posted by @bschmalhofer in https://github.com/RotherOSS/otobo/issues/3628#issuecomment-2264864549

bschmalhofer commented 3 months ago

Triggering _docker_image_builderrel.yml when a tag is pushed is working. The next step is to set up an reusable workflow, see https://docs.github.com/en/actions/using-workflows/reusing-workflows .

bschmalhofer commented 3 months ago

Turns out that reusable workflows are not a good solution for simply eliminating code duplication in workflows. Local composite actions are a better approach, https://docs.github.com/en/actions/creating-actions/creating-a-composite-action .

bschmalhofer commented 2 months ago

This has been implemented. For activating the workflow the following steps must be taken:

bschmalhofer commented 1 month ago

The changes have been made. The PR has been merged. Let's keep this issue open until we successfully made the next patch level release.

bschmalhofer commented 1 month ago

Applied the changes also to rel-10_0 and rel-10_1. This is needed because the tag updates use the actions for the current branch, not the default branch.

svenoe commented 1 month ago

This should work now, so I'll close the issue. If anything comes up again, we'll reopen or add a more specific one.

svenoe commented 1 month ago

This did not yet work for OTOBO 10.0. I will push a small change and retry with 11.0, which, if it works, might have to be backported.

svenoe commented 1 week ago

The latest images in the dockerhub building process were built via hooks/post_push. This unfortunately only seems to work for the builds being automated on dockerhub: https://docs.docker.com/docker-hub/builds/advanced/#custom-build-phase-hooks

For that reason I will change .github/workflows/docker_image_builder_rel.yml and the action to build the latest-tag depening on the branch.

svenoe commented 1 week ago

The latest images in the dockerhub building process were built via hooks/post_push. This unfortunately only seems to work for the builds being automated on dockerhub: https://docs.docker.com/docker-hub/builds/advanced/#custom-build-phase-hooks

For that reason I will change .github/workflows/docker_image_builder_rel.yml and the action to build the latest-tag depening on the branch.

"if" construct works, push does not work, some more changes necessary.

svenoe commented 1 week ago

In the above commit the latest is now provided in the "tags". According to the documentation this can also be given a list of arguments, so it would definitely be nicer to push both tags in one statement if matrix.latest and else omit the latest tag, but that can be tested at a later point in time.

svenoe commented 1 week ago

We decided to add an additional autobuild tag, which will automatically be built via cron upon base image change. This build can then be used to run tests and manually update the normal tags via workflow_dispatch.

This handling might change in future, the latest-x_xx-autobuild should not be used on productive systems.