From 6d6d42b27f19f70e3a121dfd21d0c36c673b5a0e Mon Sep 17 00:00:00 2001 From: chandi Date: Thu, 30 Jul 2020 12:11:34 +0200 Subject: [PATCH] core: only rebuild on changes --- mod/core/Dockerfile | 6 +++++- scripts/upgrade | 12 +++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index d755859..06b52a3 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get install -y supervisor apt-transport-https equivs libreoffice haveged # bbb repo & packages RUN LC_CTYPE=C.UTF-8 add-apt-repository ppa:bigbluebutton/support RUN sh -c 'wget https://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc -O- | apt-key add -' \ - && sh -c 'echo "deb https://packages-eu.bigbluebutton.org/xenial-22 bigbluebutton-xenial main" > /etc/apt/sources.list.d/bigbluebutton.list' + && sh -c 'echo "deb https://ubuntu.bigbluebutton.org/xenial-22 bigbluebutton-xenial main" > /etc/apt/sources.list.d/bigbluebutton.list' # create dummy packages to satisfy dependencies RUN equivs-control redis-server.control \ @@ -37,6 +37,10 @@ RUN equivs-control redis-server.control \ && dpkg -i /*.deb \ && rm /*.deb +# this variable is not used, but it triggers +# rebuilding from here on if changed +ENV VERSION v2.2.21 + RUN apt-get update && apt-get install -y bbb-web \ bbb-fsesl-akka bbb-apps-akka bbb-transcode-akka bbb-apps \ bbb-apps-video bbb-apps-screenshare bbb-apps-video-broadcast diff --git a/scripts/upgrade b/scripts/upgrade index f223130..07bdb12 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,6 +13,9 @@ then RESTARTED=1 ./scripts/upgrade else + # update changed environment variable + sed -i 's/EXTERNAL_IP=/EXTERNAL_IPv4=/' .env + echo "" echo "# pull newest bbb-webrtc-sfu" git submodule update --remote @@ -25,13 +28,8 @@ else echo "" echo "# rebuild images" - # rebuild core without caching, since the deb-packages might have changed - ./scripts/compose build --pull --no-cache core - - # rebuild everything else only when modified - ./scripts/compose build --pull - - sed -i 's/EXTERNAL_IP=/EXTERNAL_IPv4=/' .env + # rebuild everything which got modified + ./scripts/compose build --pull COMMIT_HASH=$(git rev-parse --short HEAD) BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)