mirror of
https://git.tt-rss.org/fox/ttrss-docker-compose
synced 2025-06-11 04:19:53 +02:00
abort build if actual commit id differs from requested for image
This commit is contained in:
parent
4a7b2aed70
commit
d419fd0c03
2 changed files with 13 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue