diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 3daf5d0..489a373 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -35,7 +35,6 @@ jobs: run: ./scripts/integration.sh env: GIT_TOKEN: ${{ github.token }} - CNB_BUILDER_IMAGE: ${{ secrets.CNB_BUILDER_IMAGE }} release: name: Release diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 1638554..2e6df34 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -35,7 +35,6 @@ jobs: run: ./scripts/integration.sh env: GIT_TOKEN: ${{ github.token }} - CNB_BUILDER_IMAGE: ${{ secrets.CNB_BUILDER_IMAGE }} approve: name: Auto Approve diff --git a/scripts/integration.sh b/scripts/integration.sh index f4bc977..4db053a 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -40,20 +40,30 @@ function tools::install() { } function images::pull() { + local builder + + if [[ -f "${BUILDPACKDIR}/integration.json" ]]; then + builder="$(jq -r .builder "${BUILDPACKDIR}/integration.json")" + fi + + if [[ "${builder}" == "null" || -z "${builder}" ]]; then + builder="index.docker.io/paketobuildpacks/builder:base" + fi + util::print::title "Pulling builder image..." - docker pull "${CNB_BUILDER_IMAGE:=index.docker.io/paketobuildpacks/builder:base}" + docker pull "${builder}" util::print::title "Setting default pack builder image..." - pack set-default-builder "${CNB_BUILDER_IMAGE}" + pack set-default-builder "${builder}" local run_image lifecycle_image run_image="$( - docker inspect "${CNB_BUILDER_IMAGE}" \ + docker inspect "${builder}" \ | jq -r '.[0].Config.Labels."io.buildpacks.builder.metadata"' \ | jq -r '.stack.runImage.image' )" lifecycle_image="index.docker.io/buildpacksio/lifecycle:$( - docker inspect "${CNB_BUILDER_IMAGE}" \ + docker inspect "${builder}" \ | jq -r '.[0].Config.Labels."io.buildpacks.builder.metadata"' \ | jq -r '.lifecycle.version' )"