From 4a7b2aed7050bf3a8c041eddc371eaecfece7356 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 23 Mar 2022 12:23:03 +0300 Subject: [PATCH] * make origin repo configurable when building image * halt build process if initial git clone fails * log resulting commit id used when building --- src/app/Dockerfile | 6 ++++++ src/app/build-prepare.sh | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/Dockerfile b/src/app/Dockerfile index b602de2..553e20b 100644 --- a/src/app/Dockerfile +++ b/src/app/Dockerfile @@ -26,6 +26,12 @@ ADD backup.sh /etc/periodic/weekly/backup ADD config.docker.php ${SCRIPT_ROOT} ADD build-prepare.sh ${SCRIPT_ROOT} +ARG ORIGIN_REPO_MAIN=https://git.tt-rss.org/fox/tt-rss.git +ARG ORIGIN_REPO_XACCEL=https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git + +ENV ORIGIN_REPO_MAIN=${ORIGIN_REPO_MAIN} +ENV ORIGIN_REPO_XACCEL=${ORIGIN_REPO_XACCEL} + RUN sh -c ${SCRIPT_ROOT}/build-prepare.sh ENV OWNER_UID=1000 diff --git a/src/app/build-prepare.sh b/src/app/build-prepare.sh index 5e5a5c2..2af037c 100755 --- a/src/app/build-prepare.sh +++ b/src/app/build-prepare.sh @@ -1,10 +1,15 @@ -#!/bin/sh +#!/bin/sh -e DST_DIR=/src/tt-rss mkdir -p $DST_DIR -git clone --branch master --depth 1 https://git.tt-rss.org/fox/tt-rss.git $DST_DIR -git clone --branch master --depth 1 https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel +echo cloning $ORIGIN_REPO_MAIN to $DST_DIR... +git clone --branch master --depth 1 $ORIGIN_REPO_MAIN $DST_DIR +echo built for: $(git --git-dir=$DST_DIR/.git --no-pager log --pretty='%H' -n1 HEAD) + +echo cloning $ORIGIN_REPO_XACCEL to $DST_DIR/plugins.local/nginx_xaccel... +git clone --branch master --depth 1 $ORIGIN_REPO_XACCEL $DST_DIR/plugins.local/nginx_xaccel +echo built for: $(git --git-dir=$DST_DIR/plugins.local/nginx_xaccel/.git --no-pager log --pretty='%H' -n1 HEAD) mkdir -p /var/www