-
Notifications
You must be signed in to change notification settings - Fork 16
/
action.yml
39 lines (35 loc) · 1.29 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: "Run CustoPiZer"
description: "Runs the CustoPiZer tool"
branding:
icon: box
color: green
inputs:
workspace:
description: "Path to the workspace"
required: true
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
default: '{}'
runs:
using: "composite"
steps:
- name: "Run CustoPiZer"
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 $config_mount ghcr.io/octoprint/custopizer:latest"
echo "About to execute 'docker run $command'..."
docker run $command
shell: bash