You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
<dict>
<key>type</key>
<string>included_workflow</string>
<key>script</key>
<string>#!/usr/bin/python
model = "{{machine_model}}"
if model.startswith("VMware"):
print 'ImagrIncludedWorkflow: vmware_tools'
else:
print 'ImagrIncludedWorkflow: no_vmware_tools'</string>
</dict>
However, this means I need to embed the script into the XML, which means I need to escape any special characters such as &, this also means my script is now in a different location to my other scripts and version control becomes a bit tricky.
I tried referencing a URL as per regular scripts like this:
Not presently. I do consider this a bug though. The question is how to best handle it? I'm thinking it's best to just check for the presence of a <key>script_url</key>. E.g:
As just using url implies we're looking for the URL of the workflow itself (and would screw us over if we ever were to include components from plists via a URL in the future).
At first I was going to recommend using the same format as you're already using for the scripts component however a second glance, that doesn't make complete sense to do so.
I think your proposed script_url key would be the best way to move forward. Leaving url free makes sense as @erikng already wanted that feature but he/I never finished it.
If I have
Workflow_1
which I want to run a script to determine if the included workflow should beWorkflow_2
orWorkflow_3
I was looking at scripted included workflows as per:https://github.com/grahamgilbert/imagr/wiki/Workflow-Config#scripted-included-workflows
eg.
However, this means I need to embed the script into the XML, which means I need to escape any special characters such as &, this also means my script is now in a different location to my other scripts and version control becomes a bit tricky.
I tried referencing a URL as per regular scripts like this:
But this failed, the included workflow was just ignored, likely because of the two
type
keys in thedict
?Is there any way to use a script at a URL to echo out the correct workflow name to run as an included workflow?
The text was updated successfully, but these errors were encountered: