File tree Expand file tree Collapse file tree 6 files changed +23
-7
lines changed Expand file tree Collapse file tree 6 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 2727 uses : docker/build-push-action@v4
2828 with :
2929 build-args : |
30+ CACHEBUST_DOTFILES=${{ github.sha }}
3031 DESKTOP_ENVIRONMENT_USER=${{ env.REPOSITORY_OWNER }}
3132 DESKTOP_ENVIRONMENT_GITHUB_USER=${{ env.REPOSITORY_OWNER }}
32- DOTFILES_CACHEBUST=${{ github.sha }}
3333 cache-from : type=gha
3434 cache-to : type=gha,mode=max
3535 file : docker/Dockerfile
Original file line number Diff line number Diff line change 11.build-exit-code
22.build-exit-time
3- .dotfiles-cachebust
3+ .cachebust-apps
4+ .cachebust-dotfiles
Original file line number Diff line number Diff line change @@ -152,6 +152,10 @@ RUN apt-get update -qq && \
152152 zsh && \
153153 apt-file update
154154
155+ # If the CACHEBUST_APPS build arg is supplied, rebuild from apps onwards
156+ ARG CACHEBUST_APPS
157+ RUN echo 'Building from apps onwards...'
158+
155159# Install rust
156160RUN apt-get update -qq && \
157161 curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --no-modify-path --profile minimal && \
@@ -581,9 +585,9 @@ WORKDIR $HOME
581585# Clone the desktop environment
582586RUN git clone https://github.com/sabrehagen/desktop-environment /opt/desktop-environment
583587
584- # If the DOTFILES_CACHEBUST build arg is supplied, rebuild from static dotfiles onwards
585- ARG DOTFILES_CACHEBUST
586- RUN DOTFILES_CACHEBUST=$DOTFILES_CACHEBUST echo 'Building from dotfiles...'
588+ # If the CACHEBUST_DOTFILES build arg is supplied, rebuild from static dotfiles onwards
589+ ARG CACHEBUST_DOTFILES
590+ RUN echo 'Building from dotfiles...'
587591
588592# Clone user dotfiles or fallback to sabrehagen dotfiles
589593RUN vcsh clone https://github.com/sabrehagen/dotfiles
Original file line number Diff line number Diff line change 1+ REPO_ROOT=$( dirname $( readlink -f $0 ) ) /../..
2+
3+ # Export desktop environment shell configuration
4+ eval " $( $REPO_ROOT /docker/scripts/environment.sh) "
5+
6+ # Set the cachebust file to rebuild from apps onwards
7+ CACHEBUST_APPS=$( date +%s > $REPO_ROOT /.cachebust-apps)
8+
9+ # Rebuild the desktop environment
10+ $REPO_ROOT /docker/scripts/build.sh
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ REPO_ROOT=$(dirname $(readlink -f $0))/../..
44eval " $( $REPO_ROOT /docker/scripts/environment.sh) "
55
66# Set the cachebust file to rebuild from dotfiles onwards
7- DOTFILES_CACHEBUST =$( date +%s > $REPO_ROOT /.dotfiles- cachebust)
7+ CACHEBUST_DOTFILES =$( date +%s > $REPO_ROOT /.cachebust-dotfiles )
88
99# Rebuild the desktop environment
1010$REPO_ROOT /docker/scripts/build.sh
Original file line number Diff line number Diff line change @@ -7,13 +7,14 @@ eval "$($REPO_ROOT/docker/scripts/environment.sh)"
77DESKTOP_ENVIRONMENT_HOST_USER_PASSWORD=$( sudo cat /etc/shadow | grep $DESKTOP_ENVIRONMENT_USER | cut -d: -f2)
88
99docker build \
10+ --build-arg CACHEBUST_APPS=$( cat $REPO_ROOT /.cachebust-apps 2> /dev/null) \
11+ --build-arg CACHEBUST_DOTFILES=$( cat $REPO_ROOT /.cachebust-dotfiles 2> /dev/null) \
1012 --build-arg DESKTOP_ENVIRONMENT_CONTAINER_GIT_SHA=$( git --git-dir $REPO_ROOT /.git rev-parse HEAD | cut -b 1-7) \
1113 --build-arg DESKTOP_ENVIRONMENT_CONTAINER_BUILD_DATE=$( date +%s) \
1214 --build-arg DESKTOP_ENVIRONMENT_CONTAINER_IMAGE_NAME=" $DESKTOP_ENVIRONMENT_REGISTRY /$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE " \
1315 --build-arg DESKTOP_ENVIRONMENT_HOST_USER_PASSWORD=" $DESKTOP_ENVIRONMENT_HOST_USER_PASSWORD " \
1416 --build-arg DESKTOP_ENVIRONMENT_USER=" $DESKTOP_ENVIRONMENT_USER " \
1517 --build-arg DESKTOP_ENVIRONMENT_GITHUB_USER=" $DESKTOP_ENVIRONMENT_GITHUB_USER " \
16- --build-arg DOTFILES_CACHEBUST=$( cat $REPO_ROOT /.dotfiles-cachebust 2> /dev/null) \
1718 --file $REPO_ROOT /docker/Dockerfile \
1819 --tag $DESKTOP_ENVIRONMENT_REGISTRY /$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE :$DESKTOP_ENVIRONMENT_CONTAINER_TAG \
1920 --tag $DESKTOP_ENVIRONMENT_REGISTRY /$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE :latest \
You can’t perform that action at this time.
0 commit comments