Merge pull request #7982 from dokku/drop-cnb-experimental
Remove references to pack being experimental
This commit is contained in:
@@ -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.
|
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]
|
> [!NOTE]
|
||||||
> 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.
|
> This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ Builds will proceed with the `pack` cli for the app from then on.
|
|||||||
|
|
||||||
### Caveats
|
### 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.
|
- Specifying specific buildpacks is not currently possible.
|
||||||
- A future release will add support for specifying buildpacks via the `buildpacks` plugin.
|
- 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
|
### Detection
|
||||||
|
|
||||||
This builder will be auto-detected in either the following cases:
|
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 `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.
|
|
||||||
|
|
||||||
The builder can also be specified via the `builder:set` command:
|
The builder can also be specified via the `builder:set` command:
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ trigger-builder-pack-builder-detect() {
|
|||||||
echo "pack"
|
echo "pack"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$(config_get "$APP" DOKKU_CNB_EXPERIMENTAL || true)" == "1" ]]; then
|
|
||||||
echo "pack"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger-builder-pack-builder-detect "$@"
|
trigger-builder-pack-builder-detect "$@"
|
||||||
|
|||||||
@@ -665,11 +665,6 @@ dokku_receive() {
|
|||||||
|
|
||||||
docker_cleanup "$APP"
|
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"
|
plugn trigger builder-set-property "$APP" "detected" "$IMAGE_SOURCE_TYPE"
|
||||||
if ! dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"; then
|
if ! dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"; then
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -94,7 +94,12 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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 "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ setup_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
global_setup
|
||||||
create_app
|
create_app
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
destroy_app
|
destroy_app
|
||||||
|
global_teardown
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(builder-pack:set)" {
|
@test "(builder-pack:set)" {
|
||||||
@@ -30,7 +32,7 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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 "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
@@ -80,7 +82,7 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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 "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
@@ -102,10 +104,25 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize_for_cnb() {
|
@test "(ps) cnb env vars" {
|
||||||
local APP="$1"
|
run /bin/bash -c "dokku config:set $TEST_APP APP_RESPECTS_ENV_VARS=1"
|
||||||
local APP_REPO_DIR="$2"
|
echo "output: $output"
|
||||||
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
echo "status: $status"
|
||||||
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
|
assert_success
|
||||||
mv "$APP_REPO_DIR/app-cnb.json" "$APP_REPO_DIR/app.json"
|
|
||||||
|
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"'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,19 +99,6 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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]" {
|
@test "(builder) builder-detect [dockerfile]" {
|
||||||
|
|||||||
@@ -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"'
|
|
||||||
}
|
|
||||||
@@ -68,7 +68,12 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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 "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
Reference in New Issue
Block a user