refactor: set deploy-source and metadata at deploy time

This ensures the value is correct, where previously it was computed based on a file - and therefore did not distinguish between git:from-archive and git:from-image.

Closes #4464
This commit is contained in:
Jose Diaz-Gonzalez
2021-10-09 23:37:53 -04:00
parent cd7b8afccb
commit c0b6942392
12 changed files with 112 additions and 77 deletions

View File

@@ -446,33 +446,6 @@ APP="$1" IMAGE_TAG="$2" PROC_TYPE="$3"
# TODO
```
### `deploy-source`
- Description: Used for reporting what the current detected deployment source is. The first detected source should always win.
- Invoked by: `dokku apps:report`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Checks if the app should be deployed via git
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"
STDIN=$(cat)
# bail if another source is detected
if [[ -n "$STDIN" ]]; then
echo "$STDIN"
return
fi
if [[ -d "$DOKKU_ROOT/$APP/refs" ]]; then
echo "git"
fi
```
### `deployed-app-image-repo`
- Description: Used to manage the full repo of the image being deployed. Useful for deploying from an external registry where the repository name is not `dokku/$APP`