diff --git a/.gitea/workflows/BuildTestPublish.yaml b/.gitea/workflows/BuildTestPublish.yaml index 69e8e72..6cf95cc 100644 --- a/.gitea/workflows/BuildTestPublish.yaml +++ b/.gitea/workflows/BuildTestPublish.yaml @@ -26,7 +26,7 @@ jobs: password: ${{ secrets.DOCKER_PUSH_TOKEN }} - name: Build Test Publish All run: | - SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} RELEASE_WRITE_TOKEN=${{ secrets.RELEASE_WRITE_TOKEN }} ./buildtestpublish_all.sh + SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} RELEASE_WRITE_TOKEN=${{ secrets.RELEASE_WRITE_TOKEN }} ./buildtestpublish_all.sh --no-cache test-install-from-scratch: needs: [build] diff --git a/bb64/build.sh b/bb64/build.sh index 9b3fe48..32ce623 100755 --- a/bb64/build.sh +++ b/bb64/build.sh @@ -13,7 +13,14 @@ mkdir -p "${SCRIPT_DIR}/output" # make sure we have the latest base image. docker pull gitea.jde.nz/public/dropshell-build-base:latest +# Build with or without cache based on NO_CACHE environment variable +CACHE_FLAG="" +if [ "${NO_CACHE:-false}" = "true" ]; then + CACHE_FLAG="--no-cache" +fi + docker build \ + ${CACHE_FLAG} \ -t "${PROJECT}-build" \ -f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \ --build-arg PROJECT="${PROJECT}" \ diff --git a/buildtestpublish_all.sh b/buildtestpublish_all.sh index ea07165..de15d32 100755 --- a/buildtestpublish_all.sh +++ b/buildtestpublish_all.sh @@ -2,6 +2,13 @@ set -uo pipefail # Remove -e to handle errors manually SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +# Parse command line arguments +NO_CACHE=false +if [[ "$*" == *"--no-cache"* ]]; then + NO_CACHE=true + export NO_CACHE +fi + docker builder prune -f diff --git a/dehydrate/build.sh b/dehydrate/build.sh index 841dedf..93b5a21 100755 --- a/dehydrate/build.sh +++ b/dehydrate/build.sh @@ -13,7 +13,14 @@ mkdir -p "${SCRIPT_DIR}/output" # make sure we have the latest base image. docker pull gitea.jde.nz/public/dropshell-build-base:latest +# Build with or without cache based on NO_CACHE environment variable +CACHE_FLAG="" +if [ "${NO_CACHE:-false}" = "true" ]; then + CACHE_FLAG="--no-cache" +fi + docker build \ + ${CACHE_FLAG} \ -t "${PROJECT}-build" \ -f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \ --build-arg PROJECT="${PROJECT}" \ diff --git a/getpkg/build.sh b/getpkg/build.sh index 8ca1644..a1a5709 100755 --- a/getpkg/build.sh +++ b/getpkg/build.sh @@ -15,7 +15,14 @@ PROJECT="getpkg" # make sure we have the latest base image. docker pull gitea.jde.nz/public/dropshell-build-base:latest +# Build with or without cache based on NO_CACHE environment variable +CACHE_FLAG="" +if [ "${NO_CACHE:-false}" = "true" ]; then + CACHE_FLAG="--no-cache" +fi + docker build \ + ${CACHE_FLAG} \ -t "${PROJECT}-build" \ -f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \ --build-arg PROJECT="${PROJECT}" \