From 4e6d7973c7c41974b76d9403c3015521bc7392f5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 12 Sep 2021 03:28:55 -0400 Subject: [PATCH] dev: add convenience copy-file bin and fix data path used by plugin --- .devcontainer/20_init_plugin | 2 +- .devcontainer/Dockerfile | 1 + .devcontainer/bin/copy-file | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 .devcontainer/bin/copy-file diff --git a/.devcontainer/20_init_plugin b/.devcontainer/20_init_plugin index 88dda7b..d2f4cd2 100755 --- a/.devcontainer/20_init_plugin +++ b/.devcontainer/20_init_plugin @@ -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 "$@" \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2d09be4..187503c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 . . diff --git a/.devcontainer/bin/copy-file b/.devcontainer/bin/copy-file new file mode 100755 index 0000000..a970307 --- /dev/null +++ b/.devcontainer/bin/copy-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 "$@"