Icinga / docker-icingaweb2

GNU General Public License v2.0
16 stars 11 forks source link

Introduce explicit build mode and clean up code #79

Closed julianbrost closed 2 years ago

julianbrost commented 2 years ago

This commit introduces an explicit build mode in get-mods.sh that determines how the versions of external modules are selected.

Possible modes are:

In action.bash, the mode is automatically set based on the GITHUB_REF variable. For tags starting with v (i.e. version tags like v2.9.0) it is release, other tag names are not supported. For branches it is snapshot.

Tests

master

https://github.com/julianbrost/icingaweb2/runs/5550768750?check_suite_focus=true

Uses branch name as tag for the Docker image, selects snapshot mode and selects dev versions:

 + MODE=snapshot
+ TAG=master
+ TAG=master
+ mkimg
+ test -n master
+ test -n snapshot
[...]
+ REF=snapshot/nightly

v42.23

https://github.com/julianbrost/icingaweb2/runs/5550770184?check_suite_focus=true

Uses tag name with v prefix trimmed as tag for the Docker image, selects release mode and selects released versions:

+ MODE=release
+ TAG=42.23
+ mkimg
+ test -n 42.23
+ test -n release
[...]
+ REF=v0.7.0

action-test-without-prefix

https://github.com/julianbrost/icingaweb2/runs/5550850774?check_suite_focus=true

Uses branch name as tag for the Docker image, selects snapshot mode and selects dev versions:

 + MODE=snapshot
+ TAG=action-test-without-prefix
+ TAG=action-test-without-prefix
+ mkimg
+ test -n action-test-without-prefix
+ test -n snapshot
[...]
+ REF=snapshot/nightly

feature/action-test-with-prefix

https://github.com/julianbrost/icingaweb2/runs/5550852672?check_suite_focus=true

Uses branch name with feature/ prefix trimmed as tag for the Docker image, selects snapshot mode and selects dev versions:

+ MODE=snapshot
+ TAG=feature/action-test-with-prefix
+ TAG=action-test-with-prefix
+ mkimg
+ test -n action-test-with-prefix
+ test -n snapshot
[...]
+ REF=snapshot/nightly

fixes #62 closes #73 closes #78

dwt commented 2 years ago

@julianbrost @lippserd As far as I can tell the docker image is still not usable because of css build failures that this pull request is probably addressing.

a) am I right? b) if that its the case, what is currently holding this back? Getting the build actually working again would seem to be of rather big importance to me?

dwt commented 2 years ago

🎉