dev: add convenience copy-file bin and fix data path used by plugin

This commit is contained in:
Jose Diaz-Gonzalez
2021-09-12 03:28:57 -04:00
parent 3418f4d76e
commit ec9b0049cf
3 changed files with 10 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ main() {
# 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}"
echo "export ${PLUGIN_VARIABLE}_HOST_ROOT=${SERVICE_HOST_ROOT}/$PLUGIN_NAME" > /etc/default/dokku
}
main "$@"

View File

@@ -12,6 +12,7 @@ RUN apt-get install --no-install-recommends -y build-essential && \
ADD https://raw.githubusercontent.com/dokku/dokku/master/tests/dhparam.pem /mnt/dokku/etc/nginx/dhparam.pem
COPY .devcontainer/20_init_plugin /etc/my_init.d/20_init_plugin
COPY .devcontainer/bin/ /usr/local/bin/
COPY . .

8
.devcontainer/bin/copy-file Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
main() {
PLUGIN_NAME="$(source /tmp/.env && echo "$PLUGIN_NAME")"
cp "$1" "/var/lib/dokku/plugins/enabled/$PLUGIN_NAME/$1"
}
main "$@"