Skip to content

Commit

Permalink
Fix Heruko buildpacks samples
Browse files Browse the repository at this point in the history
Ref: heroku/buildpacks-procfile#214
Ref: heroku/libcnb.rs@033f612

Add `CNB_TARGET_OS` and `CNB_TARGET_ARCH` to fix error during the detect
phase, where the target system cannot be detected:
```
[Error: Internal Buildpack Error]
Couldn't determine target os: environment variable not found
err:  heroku/[email protected] (1)
======== Output: heroku/[email protected] ========
```

There seems to be a changed behavior that was introduced in the common
buildpacks library that is in use that expects these environment
variables to be present to detect the target system OS and architecture.

Signed-off-by: Matthias Diester <[email protected]>
  • Loading branch information
HeavyWombat committed Feb 29, 2024
1 parent 1cdb949 commit 1beb274
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ spec:
- name: platform-env
emptyDir: {}
parameters:
- name: operating-system
description: TBD
default: "linux"
- name: system-architecture
description: TBD
default: "x86_64"
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.7"
buildSteps:
- name: build-and-push
image: heroku/builder:22
env:
- name: CNB_TARGET_OS
value: $(params.operating-system)
- name: CNB_TARGET_ARCH
value: $(params.system-architecture)
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down Expand Up @@ -62,7 +72,7 @@ spec:
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ spec:
- name: platform-env
emptyDir: {}
parameters:
- name: operating-system
description: TBD
default: "linux"
- name: system-architecture
description: TBD
default: "x86_64"
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.7"
buildSteps:
- name: build-and-push
image: heroku/builder:22
env:
- name: CNB_TARGET_OS
value: $(params.operating-system)
- name: CNB_TARGET_ARCH
value: $(params.system-architecture)
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ spec:
- name: platform-env
emptyDir: {}
parameters:
- name: operating-system
description: TBD
default: "linux"
- name: system-architecture
description: TBD
default: "x86_64"
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.7"
steps:
- name: build-and-push
image: heroku/builder:22
env:
- name: CNB_TARGET_OS
value: $(params.operating-system)
- name: CNB_TARGET_ARCH
value: $(params.system-architecture)
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down Expand Up @@ -62,7 +72,7 @@ spec:
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ spec:
- name: platform-env
emptyDir: {}
parameters:
- name: operating-system
description: TBD
default: "linux"
- name: system-architecture
description: TBD
default: "x86_64"
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.7"
steps:
- name: build-and-push
image: heroku/builder:22
env:
- name: CNB_TARGET_OS
value: $(params.operating-system)
- name: CNB_TARGET_ARCH
value: $(params.system-architecture)
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down

0 comments on commit 1beb274

Please sign in to comment.