#!/bin/bash # Icinga Web 2 Docker image | (c) 2020 Icinga GmbH | GPLv2+ set -exo pipefail TARGET=icinga/icingaweb2 mkimg () { test -n "$TAG" node /actions/checkout/dist/index.js |grep -vFe ::add-matcher:: git archive --prefix=icingaweb2/ HEAD |tar -x /get-mods.sh "$1" /composer.bash patch -d icingaweb2 -p0 < /icingaweb2.patch cp -r /entrypoint . docker build -f /Dockerfile -t "${TARGET}:$TAG" . STATE_isPost=1 node /actions/checkout/dist/index.js } push () { test -n "$TAG" if [ "$(tr -d '\n' <<<"$DOCKER_HUB_PASSWORD" |wc -c)" -gt 0 ]; then docker login -u icingaadmin --password-stdin <<<"$DOCKER_HUB_PASSWORD" docker push "${TARGET}:$TAG" docker logout fi } # Matches Git references that start with `refs/` and then continue with `heads/` or `tags/`. # An optional `v` that follows is ignored. Then the tag or branch name is captured. These may # be of the following forms and what is captured of them: # # -