dev: make devcontainer setup plugin agnostic

This commit is contained in:
Jose Diaz-Gonzalez
2021-09-12 02:39:17 -04:00
parent 25ab99a4e2
commit 8699bd9c45
3 changed files with 37 additions and 6 deletions

24
.devcontainer/20_init_plugin Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -eo pipefail
log-info() {
declare desc="Log info formatter"
echo " $*" 1>&2
}
log-fail() {
declare desc="Log fail formatter"
echo "! $*" 1>&2
exit 1
}
main() {
dokku plugin:install
# built in the Dockerfile
PLUGIN_NAME="$(source /tmp/.env && echo "$PLUGIN_NAME")"
PLUGIN_VARIABLE="$(source /tmp/.env && echo "$PLUGIN_VARIABLE")"
dokku config:set --global "${PLUGIN_VARIABLE}_HOST_ROOT=${SERVICE_HOST_ROOT}"
}
main "$@"