There is an enhancement request to change this.
For now, the best you can do is put a blcli command in a blpackage to call your snapshot job and put the deployment job for that in the batch job.
blcli SnapshotJob executeJobAndWait
blcli SnapshotJob executeJobGetJobResultKey
You probably want the latter so that you can use the job result for an audit job
Thanks Robin, I'll give that a try.
Is there a way to make it 'generic', i.e. without having to hardcode the server name into the blcli? I've seen it done using Properties, is there another way that you know of?
Also, do you know when that enhancement is scheduled for?
What I typically do for jobs that cannot be run in a batch (Snapshot, Audit, Component Discovery) is I'll write a wrapper NSH script that does a couple of things:
1. Looks up the job key according to the job name and group specified in variables in the script.
2. Makes a call to Job clearTargetServers on the job to clear its current target. Note this is an add-on CLI command. See this thread for installation:
3. Takes all the argument hosts and uses Job addTargetServer for each one. (Note your NSH script should be of the second type, "Execute the script once passing the host list as a parameter").
4. Calls one of SnapshotJob executeJobAndWait or SnapshotJob executeJobGetJobResultKey. (Obviously for audit jobs and component discovery, use AuditJob or ComponentDiscoveryJob instead).
Then you can include the NSH script job in your batch and you are all set.