refactor: switch detected builder so first one wins
Also rename internal cnb references to pack (where possible).
This commit is contained in:
@@ -8,6 +8,24 @@ trigger-builder-dockerfile-builder-detect() {
|
||||
declare trigger="builder-detect"
|
||||
declare APP="$1" SOURCECODE_WORK_DIR="$2"
|
||||
|
||||
# hack: unfortunately our legacy code requires that buildpacks
|
||||
# are detected before dockerfile support is detected
|
||||
# as such, we need to force-check the herokuish and pack
|
||||
# builders before allowing the dockerfile check to succeed
|
||||
# in a future release, we may drop this hack, but for now,
|
||||
# such is life
|
||||
if [[ -f "$PLUGIN_ENABLED_PATH/builder-herokuish/builder-detect" ]]; then
|
||||
if [[ -n "$($PLUGIN_ENABLED_PATH/builder-herokuish/builder-detect "$APP" "$SOURCECODE_WORK_DIR")" ]]; then
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "$PLUGIN_ENABLED_PATH/builder-pack/builder-detect" ]]; then
|
||||
if [[ -n "$($PLUGIN_ENABLED_PATH/builder-pack/builder-detect "$APP" "$SOURCECODE_WORK_DIR")" ]]; then
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "$SOURCECODE_WORK_DIR/Dockerfile" ]]; then
|
||||
echo "dockerfile"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user