diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaf0c67..958dad1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,10 @@ jobs: runs-on: ubuntu-22.04 container: image: heroku/heroku:${{ matrix.stack_number }}-build + options: --user root strategy: matrix: - stack_number: ["20", "22"] + stack_number: ["20", "22", "24"] env: STACK: heroku-${{ matrix.stack_number }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cda33f..fa7e501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Warn when Aptfile contains no packages ([#126](https://github.com/heroku/heroku-buildpack-apt/pull/126)) +- Support sources parts directory for Heroku-24 compatibility ([#119](https://github.com/heroku/heroku-buildpack-apt/pull/119)) ## 2024-03-14 diff --git a/Makefile b/Makefile index cc13917..5dd5e97 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,13 @@ -test: heroku-22-build heroku-20-build +test: heroku-24-build heroku-22-build heroku-20-build shellcheck: @shellcheck -x bin/compile bin/detect bin/release bin/report +heroku-24-build: + @echo "Running tests in docker (heroku-24-build)..." + @docker run --user root -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-24" heroku/heroku:24-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;' + @echo "" + heroku-22-build: @echo "Running tests in docker (heroku-22-build)..." @docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-22" heroku/heroku:22-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;' diff --git a/bin/compile b/bin/compile index c10cdf1..711690a 100755 --- a/bin/compile +++ b/bin/compile @@ -53,6 +53,7 @@ echo "$STACK" > "$CACHE_DIR/.apt/STACK" APT_CACHE_DIR="$CACHE_DIR/apt/cache" APT_STATE_DIR="$CACHE_DIR/apt/state" APT_SOURCELIST_DIR="$CACHE_DIR/apt/sources" # place custom sources.list here +APT_SOURCEPARTS_DIR="$APT_SOURCELIST_DIR/sources.list.d" APT_SOURCES="$APT_SOURCELIST_DIR/sources.list" @@ -75,6 +76,7 @@ else mkdir -p "$APT_SOURCELIST_DIR" # make dir for sources cp -f "$BUILD_DIR/Aptfile" "$APT_CACHE_DIR/Aptfile" cat "/etc/apt/sources.list" > "$APT_SOURCES" # no cp here + cp -R "/etc/apt/sources.list.d" "$APT_SOURCEPARTS_DIR" # add custom repositories from Aptfile to sources.list # like>> :repo:deb http://cz.archive.ubuntu.com/ubuntu artful main universe if grep -q -e "^:repo:" "$BUILD_DIR/Aptfile"; then @@ -85,7 +87,7 @@ fi APT_OPTIONS=("-o" "debug::nolocking=true" "-o" "dir::cache=$APT_CACHE_DIR" "-o" "dir::state=$APT_STATE_DIR") # Override the use of /etc/apt/sources.list (sourcelist) and /etc/apt/sources.list.d/* (sourceparts). -APT_OPTIONS+=("-o" "dir::etc::sourcelist=$APT_SOURCES" "-o" "dir::etc::sourceparts=/dev/null") +APT_OPTIONS+=("-o" "dir::etc::sourcelist=$APT_SOURCES" "-o" "dir::etc::sourceparts=$APT_SOURCEPARTS_DIR") topic "Updating apt caches" apt-get "${APT_OPTIONS[@]}" update 2>&1 | indent