Merge pull request #7982 from dokku/drop-cnb-experimental

Remove references to pack being experimental
This commit is contained in:
Jose Diaz-Gonzalez
2025-11-15 16:20:17 -05:00
committed by GitHub
8 changed files with 41 additions and 81 deletions

View File

@@ -14,8 +14,8 @@ buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpa
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/builders/herokuish-buildpacks.md) for more information on how to clear buildpack build cache for an application.
> [!WARNING]
> This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
> [!NOTE]
> This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps.
## Usage
@@ -27,7 +27,7 @@ Builds will proceed with the `pack` cli for the app from then on.
### Caveats
As this functionality is highly experimental, there are a number of caveats. Please note that not all issues are listed below.
While pack is well-supported in Dokku, there are a number of caveats. Please note that not all issues are listed below.
- Specifying specific buildpacks is not currently possible.
- A future release will add support for specifying buildpacks via the `buildpacks` plugin.
@@ -41,16 +41,7 @@ As this functionality is highly experimental, there are a number of caveats. Ple
### Detection
This builder will be auto-detected in either the following cases:
- The `DOKKU_CNB_EXPERIMENTAL` app environment variable is set to `1`.
```shell
dokku config:set --no-restart node-js-app DOKKU_CNB_EXPERIMENTAL=1
```
- A `project.toml` file exists in the root of the app repository.
- This file is consumed by `pack-cli` and used to describe how the app is built.
This builder will be auto-detected if a `project.toml` file exists in the root of the app repository. This file is consumed by `pack-cli` and used to describe how the app is built.
The builder can also be specified via the `builder:set` command:

View File

@@ -12,11 +12,6 @@ trigger-builder-pack-builder-detect() {
echo "pack"
return
fi
if [[ "$(config_get "$APP" DOKKU_CNB_EXPERIMENTAL || true)" == "1" ]]; then
echo "pack"
return
fi
}
trigger-builder-pack-builder-detect "$@"

View File

@@ -665,11 +665,6 @@ dokku_receive() {
docker_cleanup "$APP"
local DOKKU_CNB_EXPERIMENTAL="$(config_get "$APP" DOKKU_CNB_EXPERIMENTAL || true)"
if [[ "$DOKKU_CNB_EXPERIMENTAL" == "1" ]]; then
IMAGE_SOURCE_TYPE="pack"
fi
plugn trigger builder-set-property "$APP" "detected" "$IMAGE_SOURCE_TYPE"
if ! dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"; then
return 1

View File

@@ -94,7 +94,12 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku config:set --no-restart $TEST_APP DOKKU_CNB_EXPERIMENTAL=1 SECRET_KEY=fjdkslafjdk"
run /bin/bash -c "dokku config:set --no-restart $TEST_APP SECRET_KEY=fjdkslafjdk"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku builder:set $TEST_APP selected pack"
echo "output: $output"
echo "status: $status"
assert_success

View File

@@ -7,11 +7,13 @@ setup_file() {
}
setup() {
global_setup
create_app
}
teardown() {
destroy_app
global_teardown
}
@test "(builder-pack:set)" {
@@ -30,7 +32,7 @@ teardown() {
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP initialize_for_cnb
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP add_requirements_txt_cnb
echo "output: $output"
echo "status: $status"
assert_success
@@ -80,7 +82,7 @@ teardown() {
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP initialize_for_cnb
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP add_requirements_txt_cnb
echo "output: $output"
echo "status: $status"
assert_success
@@ -102,10 +104,25 @@ teardown() {
assert_success
}
initialize_for_cnb() {
local APP="$1"
local APP_REPO_DIR="$2"
[[ -z "$APP" ]] && local APP="$TEST_APP"
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
mv "$APP_REPO_DIR/app-cnb.json" "$APP_REPO_DIR/app.json"
@test "(ps) cnb env vars" {
run /bin/bash -c "dokku config:set $TEST_APP APP_RESPECTS_ENV_VARS=1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku builder:set $TEST_APP selected pack"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP add_requirements_txt_cnb
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "curl $(dokku url $TEST_APP)/env"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains '"APP_RESPECTS_ENV_VARS": "1"'
}

View File

@@ -99,19 +99,6 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
# test DOKKU_CNB_EXPERIMENTAL env var
run /bin/bash -c "dokku config:set $TEST_APP DOKKU_CNB_EXPERIMENTAL=1"
echo "output: $output"
echo "status: $status"
assert_success
chown -R dokku:dokku "$TMP"
run /bin/bash -c "dokku plugin:trigger builder-detect $TEST_APP $TMP"
echo "output: $output"
echo "status: $status"
assert_success
assert_line 0 "pack"
}
@test "(builder) builder-detect [dockerfile]" {

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env bats
load test_helper
setup_file() {
install_pack
}
setup() {
global_setup
create_app
}
teardown() {
destroy_app
global_teardown
}
@test "(ps) cnb env vars" {
run /bin/bash -c "dokku config:set $TEST_APP DOKKU_CNB_EXPERIMENTAL=1"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP add_requirements_txt_cnb
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "curl $(dokku url $TEST_APP)/env"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains '"DOKKU_CNB_EXPERIMENTAL": "1"'
}

View File

@@ -68,7 +68,12 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku config:set --no-restart $TEST_APP DOKKU_CNB_EXPERIMENTAL=1 SECRET_KEY=fjdkslafjdk"
run /bin/bash -c "dokku config:set --no-restart $TEST_APP SECRET_KEY=fjdkslafjdk"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku builder:set $TEST_APP selected pack"
echo "output: $output"
echo "status: $status"
assert_success