mirror of
https://github.com/Icinga/docker-icingaweb2.git
synced 2025-10-23 21:11:00 +02:00
commit
537d520f91
@ -1,5 +1,5 @@
|
|||||||
FROM icinga/icingaweb2-builder
|
FROM icinga/icingaweb2-builder
|
||||||
|
|
||||||
COPY action.bash Dockerfile get-mods.sh icingaweb2.patch /
|
COPY action.bash composer.bash Dockerfile get-mods.sh icingaweb2.patch /
|
||||||
|
|
||||||
CMD ["/action.bash"]
|
CMD ["/action.bash"]
|
||||||
|
|||||||
13
action.bash
13
action.bash
@ -9,18 +9,9 @@ mkimg () {
|
|||||||
node /actions/checkout/dist/index.js |grep -vFe ::add-matcher::
|
node /actions/checkout/dist/index.js |grep -vFe ::add-matcher::
|
||||||
|
|
||||||
git archive --prefix=icingaweb2/ HEAD |tar -x
|
git archive --prefix=icingaweb2/ HEAD |tar -x
|
||||||
|
|
||||||
/get-mods.sh "$1"
|
/get-mods.sh "$1"
|
||||||
|
/composer.bash
|
||||||
for d in icingaweb2 icingaweb2/modules/*; do
|
|
||||||
pushd "$d"
|
|
||||||
|
|
||||||
if [ -e composer.json ]; then
|
|
||||||
composer install --no-dev --ignore-platform-reqs
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
patch -d icingaweb2 -p0 < /icingaweb2.patch
|
patch -d icingaweb2 -p0 < /icingaweb2.patch
|
||||||
|
|
||||||
docker build -f /Dockerfile -t "${TARGET}:$TAG" .
|
docker build -f /Dockerfile -t "${TARGET}:$TAG" .
|
||||||
|
|||||||
37
build.bash
Executable file
37
build.bash
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -exo pipefail
|
||||||
|
|
||||||
|
IW2SRC="$1"
|
||||||
|
export MODS_BRANCH="$2"
|
||||||
|
|
||||||
|
if [ -z "$IW2SRC" ]; then
|
||||||
|
cat <<EOF >&2
|
||||||
|
Usage: ${0} /icingaweb2/source/dir
|
||||||
|
EOF
|
||||||
|
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
|
||||||
|
IW2SRC="$(realpath "$IW2SRC")"
|
||||||
|
BLDCTX="$(realpath "$(dirname "$0")")"
|
||||||
|
|
||||||
|
docker build -f "${BLDCTX}/action-base.Dockerfile" -t icinga/icingaweb2-builder "$BLDCTX"
|
||||||
|
docker build -f "${BLDCTX}/deps.Dockerfile" -t icinga/icingaweb2-deps "$BLDCTX"
|
||||||
|
|
||||||
|
docker run --rm -i \
|
||||||
|
-v "${IW2SRC}:/iw2src:ro" \
|
||||||
|
-v "${BLDCTX}:/bldctx:ro" \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
-e MODS_BRANCH \
|
||||||
|
icinga/icingaweb2-builder bash <<EOF
|
||||||
|
set -exo pipefail
|
||||||
|
|
||||||
|
git -C /iw2src archive --prefix=iw2cp/icingaweb2/ HEAD |tar -xC /
|
||||||
|
cd /iw2cp
|
||||||
|
|
||||||
|
/bldctx/get-mods.sh "$MODS_BRANCH"
|
||||||
|
/bldctx/composer.bash
|
||||||
|
patch -d icingaweb2 -p0 < /bldctx/icingaweb2.patch
|
||||||
|
|
||||||
|
docker build -f /bldctx/Dockerfile -t icinga/icingaweb2 .
|
||||||
|
EOF
|
||||||
12
composer.bash
Executable file
12
composer.bash
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -exo pipefail
|
||||||
|
|
||||||
|
for d in icingaweb2 icingaweb2/modules/*; do
|
||||||
|
pushd "$d"
|
||||||
|
|
||||||
|
if [ -e composer.json ]; then
|
||||||
|
composer install --no-dev --ignore-platform-reqs
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd
|
||||||
|
done
|
||||||
Loading…
x
Reference in New Issue
Block a user