Skip to content

Commit

Permalink
✨ Expose config.local to action
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Oct 12, 2021
1 parent 7d65b8e commit 85d4d4b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 85d4d4b

Please sign in to comment.