chore: deprecate the builder-specific pre-build-* triggers in favor of a global pre-build trigger
The pre-build trigger takes a `BUILDER_TYPE` parameter, allowing folks to perform specific actions as needed.
This commit is contained in:
1 parent
b19b409dd6
commit
a433508fb1
6 files changed
+66
-21
No files matched your search
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
## Deprecations
|
## Deprecations
|
||||||
|
|
||||||
|
- The following `pre-build-*` plugin triggers have been deprecated and will be removed in the next release. Users should instead trigger the `pre-build` plugin trigger.
|
||||||
|
- pre-build-buildpack
|
||||||
|
- pre-build-dockerfile
|
||||||
|
- pre-build-lambda
|
||||||
|
- pre-build-pack
|
||||||
- The following `pre-release-*` plugin triggers have been deprecated and will be removed in the next release. Users should instead trigger the `pre-release-builder` plugin trigger.
|
- The following `pre-release-*` plugin triggers have been deprecated and will be removed in the next release. Users should instead trigger the `pre-release-builder` plugin trigger.
|
||||||
- pre-release-buildpack
|
- pre-release-buildpack
|
||||||
- pre-release-dockerfile
|
- pre-release-dockerfile
|
||||||
|
|||||||
@@ -1794,8 +1794,26 @@ APP="$1";
|
|||||||
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
|
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `pre-build`
|
||||||
|
|
||||||
|
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container.
|
||||||
|
- Invoked by: `internal function dokku_build() (build phase)`
|
||||||
|
- Arguments: `$BUILDER_TYPE $APP $SOURCECODE_WORK_DIR`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `pre-build-buildpack`
|
### `pre-build-buildpack`
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Deprecated, please use `pre-build` instead
|
||||||
|
|
||||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using buildpacks.
|
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using buildpacks.
|
||||||
- Invoked by: `internal function dokku_build() (build phase)`
|
- Invoked by: `internal function dokku_build() (build phase)`
|
||||||
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
||||||
@@ -1809,8 +1827,29 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `pre-build-dockerfile`
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Deprecated, please use `pre-build` instead
|
||||||
|
|
||||||
|
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using a dockerfile.
|
||||||
|
- Invoked by: `internal function dokku_build() (build phase)`
|
||||||
|
- Arguments: `$APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `pre-build-lambda`
|
### `pre-build-lambda`
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Deprecated, please use `pre-build` instead
|
||||||
|
|
||||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using lambda.
|
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using lambda.
|
||||||
- Invoked by: `internal function dokku_build() (build phase)`
|
- Invoked by: `internal function dokku_build() (build phase)`
|
||||||
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
- Arguments: `$APP` `$SOURCECODE_WORK_DIR`
|
||||||
@@ -1827,8 +1866,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
### `pre-build-pack`
|
### `pre-build-pack`
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> The pack plugin trigger apis are under development and may change
|
> Deprecated, please use `pre-build` instead
|
||||||
> between minor releases until the 1.0 release.
|
|
||||||
|
|
||||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using pack.
|
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using pack.
|
||||||
- Invoked by: `internal function dokku_build() (build phase)`
|
- Invoked by: `internal function dokku_build() (build phase)`
|
||||||
@@ -1843,21 +1881,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
### `pre-build-dockerfile`
|
|
||||||
|
|
||||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using a dockerfile.
|
|
||||||
- Invoked by: `internal function dokku_build() (build phase)`
|
|
||||||
- Arguments: `$APP`
|
|
||||||
- Example:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|
||||||
|
|
||||||
# TODO
|
|
||||||
```
|
|
||||||
|
|
||||||
### `pre-delete`
|
### `pre-delete`
|
||||||
|
|
||||||
- Description: Can be used to run commands before an app is deleted.
|
- Description: Can be used to run commands before an app is deleted.
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ trigger-builder-dockerfile-builder-build() {
|
|||||||
|
|
||||||
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
||||||
|
|
||||||
plugn trigger pre-build-dockerfile "$APP"
|
if fn-plugn-trigger-exists "pre-build-dockerfile"; then
|
||||||
|
dokku_log_warn "Deprecated: please upgrade plugin to use 'pre-build' plugin trigger instead of pre-build-dockerfile"
|
||||||
|
plugn trigger pre-build-dockerfile "$APP"
|
||||||
|
fi
|
||||||
|
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ trigger-builder-herokuish-builder-build() {
|
|||||||
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$TAR_CID" "$IMAGE" >/dev/null
|
"$DOCKER_BIN" container commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" "$TAR_CID" "$IMAGE" >/dev/null
|
||||||
DOKKU_SKIP_IMAGE_CLEANUP_REGISTRATION=1 plugn trigger scheduler-register-retired "$APP" "$TAR_CID"
|
DOKKU_SKIP_IMAGE_CLEANUP_REGISTRATION=1 plugn trigger scheduler-register-retired "$APP" "$TAR_CID"
|
||||||
|
|
||||||
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
if fn-plugn-trigger-exists "pre-build-buildpack"; then
|
||||||
|
dokku_log_warn "Deprecated: please upgrade plugin to use 'pre-build' plugin trigger instead of pre-build-buildpack"
|
||||||
|
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
fi
|
||||||
|
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
||||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ trigger-builder-lambda-builder-build() {
|
|||||||
|
|
||||||
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
||||||
|
|
||||||
plugn trigger pre-build-lambda "$APP"
|
if fn-plugn-trigger-exists "pre-build-lambda"; then
|
||||||
|
dokku_log_warn "Deprecated: please upgrade plugin to use 'pre-build' plugin trigger instead of pre-build-lambda"
|
||||||
|
plugn trigger pre-build-lambda "$APP"
|
||||||
|
fi
|
||||||
|
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
lambda-builder build --generate-image --write-procfile --image-env=DOCKER_LAMBDA_STAY_OPEN=1 --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.image-stage=build --label=com.dokku.builder-type=lambda "--label=com.dokku.app-name=$APP" $DOKKU_GLOBAL_BUILD_ARGS --port 5000 --tag "$IMAGE" --working-directory "$SOURCECODE_WORK_DIR"
|
lambda-builder build --generate-image --write-procfile --image-env=DOCKER_LAMBDA_STAY_OPEN=1 --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.image-stage=build --label=com.dokku.builder-type=lambda "--label=com.dokku.app-name=$APP" $DOKKU_GLOBAL_BUILD_ARGS --port 5000 --tag "$IMAGE" --working-directory "$SOURCECODE_WORK_DIR"
|
||||||
if [[ ! -f "$SOURCECODE_WORK_DIR/lambda.zip" ]]; then
|
if [[ ! -f "$SOURCECODE_WORK_DIR/lambda.zip" ]]; then
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ trigger-builder-pack-builder-build() {
|
|||||||
ENV_ARGS=($(config_export app "$APP" --format pack-keys --merged))
|
ENV_ARGS=($(config_export app "$APP" --format pack-keys --merged))
|
||||||
eval "$(config_export app "$APP" --merged)"
|
eval "$(config_export app "$APP" --merged)"
|
||||||
|
|
||||||
plugn trigger pre-build-pack "$APP" "$SOURCECODE_WORK_DIR"
|
if fn-plugn-trigger-exists "pre-build-pack"; then
|
||||||
|
dokku_log_warn "Deprecated: please upgrade plugin to use 'pre-build' plugin trigger instead of pre-build-pack"
|
||||||
|
plugn trigger pre-build-pack "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
fi
|
||||||
|
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
pack build "$IMAGE" --builder "$DOKKU_CNB_BUILDER" --path "$SOURCECODE_WORK_DIR" --default-process web "${ENV_ARGS[@]}"
|
pack build "$IMAGE" --builder "$DOKKU_CNB_BUILDER" --path "$SOURCECODE_WORK_DIR" --default-process web "${ENV_ARGS[@]}"
|
||||||
docker-image-labeler relabel --label=dokku --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.image-stage=build --label=com.dokku.builder-type=pack --label=com.dokku.app-name=$APP "$IMAGE"
|
docker-image-labeler relabel --label=dokku --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.image-stage=build --label=com.dokku.builder-type=pack --label=com.dokku.app-name=$APP "$IMAGE"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user