From 7daa77f7c66eb24b2c354f46d518cfb66c9b4fa1 Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Mon, 15 Jul 2019 12:27:27 +1000 Subject: [PATCH] rebuild --- docker/Dockerfile | 36 ++++++++++++++++++-------------- docker/scripts/build-dotfiles.sh | 7 +++++++ docker/scripts/build.sh | 1 + 3 files changed, 28 insertions(+), 16 deletions(-) create mode 100755 docker/scripts/build-dotfiles.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 2c0669a..9c24be4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -272,24 +272,28 @@ RUN chown -R $USER:$USER $HOME /opt USER $USER WORKDIR $HOME +# If the DOTFILES_CACHEBUST build arg is supplied, rebuild from dotfiles onwards +ARG DOTFILES_CACHEBUST +RUN DOTFILES_CACHEBUST=$DOTFILES_CACHEBUST echo "Building from dotfiles..." + # Clone dotfiles configuration RUN vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-alacritty.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-alpine.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-code.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-git.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-mime.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-musikcube.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-polo.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-rofi.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-rpi.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-scripts.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-ssh.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-sxhkd.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-tmux.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-weechat.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-x11.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-xdg.git & \ - vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-zsh.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-alpine.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-code.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-git.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-mime.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-musikcube.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-polo.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-rofi.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-rpi.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-scripts.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-ssh.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-sxhkd.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-tmux.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-weechat.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-x11.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-xdg.git & \ + vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-zsh.git & \ wait # Cache zsh plugins diff --git a/docker/scripts/build-dotfiles.sh b/docker/scripts/build-dotfiles.sh new file mode 100755 index 0000000..db25250 --- /dev/null +++ b/docker/scripts/build-dotfiles.sh @@ -0,0 +1,7 @@ +REPO_ROOT=$(dirname $(readlink -f $0))/../.. + +# Export desktop environment shell configuration +eval "$($REPO_ROOT/docker/scripts/environment.sh)" + +# Rebuild the desktop environment from dotfiles onwards +DOTFILES_CACHEBUST=$(date) $REPO_ROOT/docker/scripts/build.sh diff --git a/docker/scripts/build.sh b/docker/scripts/build.sh index da8c948..9de7e81 100755 --- a/docker/scripts/build.sh +++ b/docker/scripts/build.sh @@ -6,6 +6,7 @@ eval "$($REPO_ROOT/docker/scripts/environment.sh)" docker build \ --build-arg DESKTOP_CONTAINER_BUILD_DATE=$(date +%s) \ --build-arg DESKTOP_CONTAINER_GIT_SHA=$(git --git-dir $REPO_ROOT/.git rev-parse HEAD | cut -b 1-7) \ + --build-arg DOTFILES_CACHEBUST \ --file $REPO_ROOT/docker/Dockerfile \ --tag $DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER_NAME:$DESKTOP_ENVIRONMENT_CONTAINER_TAG \ --tag $DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER_NAME:latest \