2022-04-17 02:08:48 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
2022-07-30 22:48:13 -04:00
|
|
|
source "$PLUGIN_AVAILABLE_PATH/builder-lambda/internal-functions"
|
2022-04-17 02:08:48 -04:00
|
|
|
set -eo pipefail
|
|
|
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
|
|
|
|
|
|
trigger-builder-lambda-core-post-extract() {
|
|
|
|
|
declare desc="builder-lambda post-extract plugin trigger"
|
|
|
|
|
declare trigger="post-extract"
|
|
|
|
|
declare APP="$1" SOURCECODE_WORK_DIR="$2"
|
2022-05-29 18:08:37 -04:00
|
|
|
local NEW_LAMBDA_YML="$(fn-builder-lambda-computed-lambdayml-path "$APP")"
|
2022-04-17 02:08:48 -04:00
|
|
|
|
|
|
|
|
pushd "$TMP_WORK_DIR" >/dev/null
|
|
|
|
|
|
|
|
|
|
if [[ -z "$NEW_LAMBDA_YML" ]]; then
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ ! -f "$NEW_LAMBDA_YML" ]]; then
|
|
|
|
|
rm -f lambda.yml
|
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2022-05-29 18:08:37 -04:00
|
|
|
if [[ "$NEW_LAMBDA_YML" != "lambda.yml" ]]; then
|
|
|
|
|
mv "$NEW_LAMBDA_YML" lambda.yml
|
2022-04-17 02:08:48 -04:00
|
|
|
fi
|
|
|
|
|
popd &>/dev/null || pushd "/tmp" >/dev/null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trigger-builder-lambda-core-post-extract "$@"
|