Skip to content

Commit

Permalink
Update Buildpacks strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaSchwarze0 committed Jun 20, 2023
1 parent 2bc9bb4 commit 45a96b8
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ spec:
parameters:
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.4"
default: "0.7"
buildSteps:
- name: build-and-push
image: heroku/buildpacks:18
image: heroku/buildpacks:20
env:
- name: ALLOW_INSECURE_HEROKU_18_BUILDER
value: "1"
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down Expand Up @@ -58,23 +56,23 @@ spec:
fi
done
LAYERS_DIR=/tmp/layers
CACHE_DIR=/tmp/cache
LAYERS_DIR=/tmp/.shp/layers
CACHE_DIR=/tmp/.shp/cache
mkdir "$CACHE_DIR" "$LAYERS_DIR"
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "DETECTING"
/cnb/lifecycle/detector -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" -cache-dir="$CACHE_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "RESTORING"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR" -layers="$LAYERS_DIR"
announce_phase "BUILDING"
/cnb/lifecycle/builder -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
Expand All @@ -86,7 +84,7 @@ spec:
/cnb/lifecycle/exporter "${exporter_args[@]}" "${PARAM_OUTPUT_IMAGE}"
# Store the image digest
grep digest /tmp/report.toml | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
grep digest /tmp/report.toml | tail -n 1 | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
volumeMounts:
- mountPath: /platform/env
name: platform-env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ spec:
parameters:
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.4"
default: "0.7"
buildSteps:
- name: build-and-push
image: heroku/buildpacks:18
image: heroku/buildpacks:20
env:
- name: ALLOW_INSECURE_HEROKU_18_BUILDER
value: "1"
- name: CNB_PLATFORM_API
value: $(params.platform-api-version)
- name: PARAM_SOURCE_CONTEXT
Expand Down Expand Up @@ -58,23 +56,23 @@ spec:
fi
done
LAYERS_DIR=/tmp/layers
CACHE_DIR=/tmp/cache
LAYERS_DIR=/tmp/.shp/layers
CACHE_DIR=/tmp/.shp/cache
mkdir "$CACHE_DIR" "$LAYERS_DIR"
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "DETECTING"
/cnb/lifecycle/detector -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" -cache-dir="$CACHE_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "RESTORING"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR" -layers="$LAYERS_DIR"
announce_phase "BUILDING"
/cnb/lifecycle/builder -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
Expand All @@ -86,7 +84,7 @@ spec:
/cnb/lifecycle/exporter "${exporter_args[@]}" "${PARAM_OUTPUT_IMAGE}"
# Store the image digest
grep digest /tmp/report.toml | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
grep digest /tmp/report.toml | tail -n 1 | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
volumeMounts:
- mountPath: /platform/env
name: platform-env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
parameters:
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.4"
default: "0.7"
buildSteps:
- name: build-and-push
image: docker.io/paketobuildpacks/builder-jammy-full:latest
Expand Down Expand Up @@ -56,23 +56,23 @@ spec:
fi
done
LAYERS_DIR=/tmp/layers
CACHE_DIR=/tmp/cache
LAYERS_DIR=/tmp/.shp/layers
CACHE_DIR=/tmp/.shp/cache
mkdir "$CACHE_DIR" "$LAYERS_DIR"
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "DETECTING"
/cnb/lifecycle/detector -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" -cache-dir="$CACHE_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "RESTORING"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR" -layers="$LAYERS_DIR"
announce_phase "BUILDING"
/cnb/lifecycle/builder -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
Expand All @@ -84,7 +84,7 @@ spec:
/cnb/lifecycle/exporter "${exporter_args[@]}" "${PARAM_OUTPUT_IMAGE}"
# Store the image digest
grep digest /tmp/report.toml | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
grep digest /tmp/report.toml | tail -n 1 | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
volumeMounts:
- mountPath: /platform/env
name: platform-env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
parameters:
- name: platform-api-version
description: The referenced version is the minimum version that all relevant buildpack implementations support.
default: "0.4"
default: "0.7"
buildSteps:
- name: build-and-push
image: docker.io/paketobuildpacks/builder-jammy-full:latest
Expand Down Expand Up @@ -56,23 +56,23 @@ spec:
fi
done
LAYERS_DIR=/tmp/layers
CACHE_DIR=/tmp/cache
LAYERS_DIR=/tmp/.shp/layers
CACHE_DIR=/tmp/.shp/cache
mkdir "$CACHE_DIR" "$LAYERS_DIR"
mkdir -p "$CACHE_DIR" "$LAYERS_DIR"
function announce_phase {
printf "===> %s\n" "$1"
}
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "DETECTING"
/cnb/lifecycle/detector -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
announce_phase "ANALYZING"
/cnb/lifecycle/analyzer -layers="$LAYERS_DIR" -cache-dir="$CACHE_DIR" "${PARAM_OUTPUT_IMAGE}"
announce_phase "RESTORING"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR"
/cnb/lifecycle/restorer -cache-dir="$CACHE_DIR" -layers="$LAYERS_DIR"
announce_phase "BUILDING"
/cnb/lifecycle/builder -app="${PARAM_SOURCE_CONTEXT}" -layers="$LAYERS_DIR"
Expand All @@ -84,7 +84,7 @@ spec:
/cnb/lifecycle/exporter "${exporter_args[@]}" "${PARAM_OUTPUT_IMAGE}"
# Store the image digest
grep digest /tmp/report.toml | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
grep digest /tmp/report.toml | tail -n 1 | tr -d ' \"\n' | sed s/digest=// > "$(results.shp-image-digest.path)"
volumeMounts:
- mountPath: /platform/env
name: platform-env
Expand Down

0 comments on commit 45a96b8

Please sign in to comment.