From 85d4d4b2b4ad19407f579823a8422cb4b521388c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 12 Oct 2021 17:36:45 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Expose=20config.local=20to=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9c252c9..b1c068e 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,10 @@ inputs: scripts: description: "Path to the scripts to mount" required: true + config: + description: "Path to an optional config file 'config.local', e.g. to override file system extending/shrinking" + required: false + default: '' environment: description: "Additional environment variables to pass to the docker call, as JSON object, e.g. {'OCTOPRINT_VERSION': '1.7.0', 'OTHER_VAR': 'value'}" required: false @@ -18,8 +22,14 @@ runs: run: | sudo modprobe loop + config_mount='' + if [ -f "${{ inputs.config }}" ]; then + config_mount="-v ${{ inputs.config }}:/CustoPiZer/config.local" + fi + envs=$(echo '${{ inputs.environment }}' | jq -r 'to_entries | map("-e " + .key + "=" + (.value | tostring)) | join(" ")') - command="--rm --privileged $envs -v ${{ inputs.workspace }}:/CustoPiZer/workspace -v ${{ inputs.scripts }}:/CustoPiZer/workspace/scripts ghcr.io/octoprint/custopizer:latest" + command="--rm --privileged $envs -v ${{ inputs.workspace }}:/CustoPiZer/workspace -v ${{ inputs.scripts }}:/CustoPiZer/workspace/scripts $config_mount ghcr.io/octoprint/custopizer:latest" + echo "About to execute 'docker run $command'..." docker run $command