Files
dokku/plugins/builder-pack/internal-functions
T
Jose Diaz-Gonzalez 59594937f9 feat: split stack property into per-builder properties
The `stack` property lived on the `buildpacks` plugin but was shared by both the herokuish and pack builders, so a value valid for one builder broke the other. Each builder now owns its own `stack` property managed via `builder-herokuish:set` and `builder-pack:set`, while `buildpacks:set-property stack` is deprecated and forwards the value to the builder detected from it; existing values migrate automatically on upgrade and changing a builder's stack clears that builder's cache.
2026-11-02 16:48:11 -05:00

58 lines
1.3 KiB
Bash

#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
fn-builder-pack-computed-projecttoml-path() {
declare APP="$1"
file="$(fn-builder-pack-projecttoml-path "$APP")"
if [[ "$file" == "" ]]; then
file="$(fn-builder-pack-global-projecttoml-path "$APP")"
fi
if [[ "$file" == "" ]]; then
file="project.toml"
fi
echo "$file"
}
fn-builder-pack-global-projecttoml-path() {
declare APP="$1"
fn-plugin-property-get-default "builder-pack" "--global" "projecttoml-path" ""
}
fn-builder-pack-projecttoml-path() {
declare APP="$1"
fn-plugin-property-get-default "builder-pack" "$APP" "projecttoml-path" ""
}
fn-builder-pack-computed-stack() {
declare APP="$1"
stack="$(fn-builder-pack-stack "$APP")"
if [[ "$stack" == "" ]]; then
stack="$(fn-builder-pack-global-stack "$APP")"
fi
if [[ "$stack" == "" ]]; then
stack="${DOKKU_CNB_BUILDER:-heroku/builder:24}"
fi
echo "$stack"
}
fn-builder-pack-global-stack() {
declare APP="$1"
fn-plugin-property-get-default "builder-pack" "--global" "stack" ""
}
fn-builder-pack-stack() {
declare APP="$1"
fn-plugin-property-get-default "builder-pack" "$APP" "stack" ""
}