aboutsummaryrefslogtreecommitdiff
path: root/Docker/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'Docker/hooks')
-rwxr-xr-xDocker/hooks/build21
-rw-r--r--Docker/hooks/post_checkout4
-rwxr-xr-xDocker/hooks/pre_build11
3 files changed, 36 insertions, 0 deletions
diff --git a/Docker/hooks/build b/Docker/hooks/build
new file mode 100755
index 000000000..84e759a80
--- /dev/null
+++ b/Docker/hooks/build
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+cd ..
+FRESHRSS_VERSION=$(grep "'FRESHRSS_VERSION'" constants.php | cut -d "'" -f4)
+echo "$FRESHRSS_VERSION"
+
+if [[ $DOCKERFILE_PATH == *-ARM ]]; then
+ #TODO: Add --squash --platform arm options when Docker Hub deamon supports them
+ docker build \
+ --build-arg FRESHRSS_VERSION="$FRESHRSS_VERSION" \
+ --build-arg SOURCE_BRANCH="$SOURCE_BRANCH" \
+ --build-arg SOURCE_COMMIT="$SOURCE_COMMIT" \
+ -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
+else
+ #TODO: Add --squash option when Docker Hub deamon supports it
+ docker build \
+ --build-arg FRESHRSS_VERSION="$FRESHRSS_VERSION" \
+ --build-arg SOURCE_BRANCH="$SOURCE_BRANCH" \
+ --build-arg SOURCE_COMMIT="$SOURCE_COMMIT" \
+ -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
+fi
diff --git a/Docker/hooks/post_checkout b/Docker/hooks/post_checkout
new file mode 100644
index 000000000..b33c941e5
--- /dev/null
+++ b/Docker/hooks/post_checkout
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+mv ../README.md ../README.en.md
+mv README.md ../
diff --git a/Docker/hooks/pre_build b/Docker/hooks/pre_build
new file mode 100755
index 000000000..b2cda0e48
--- /dev/null
+++ b/Docker/hooks/pre_build
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [[ $DOCKERFILE_PATH == *-ARM ]]; then
+ # https://github.com/balena-io/qemu
+ # Download a local copy of QEMU on Docker Hub build machine
+ curl -LSs 'https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz' | tar -xzv --strip-components=1 --wildcards '*/qemu-*'
+
+ # https://github.com/multiarch/qemu-user-static
+ # Register qemu-*-static for all supported processors except the current one, but also remove all registered binfmt_misc before
+ docker run --rm --privileged multiarch/qemu-user-static:register --reset
+fi