abort build if actual commit id differs from requested for image

pull/5/head
Andrew Dolgov 3 years ago
parent 4a7b2aed70
commit d419fd0c03

@ -28,9 +28,11 @@ 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
ARG ORIGIN_COMMIT=
ENV ORIGIN_REPO_MAIN=${ORIGIN_REPO_MAIN}
ENV ORIGIN_REPO_XACCEL=${ORIGIN_REPO_XACCEL}
ENV ORIGIN_COMMIT=${ORIGIN_COMMIT}
RUN sh -c ${SCRIPT_ROOT}/build-prepare.sh

@ -4,9 +4,19 @@ DST_DIR=/src/tt-rss
mkdir -p $DST_DIR
echo requested commit: $ORIGIN_COMMIT
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)
BUILD_COMMIT=$(git --git-dir=$DST_DIR/.git --no-pager log --pretty='%H' -n1 HEAD)
echo built for: $BUILD_COMMIT
if [ ! -z $ORIGIN_COMMIT -a "$ORIGIN_COMMIT" != "$BUILD_COMMIT" ]; then
echo actual build commit differs from requested commit, bailing out.
exit 1
fi
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

Loading…
Cancel
Save