-
Notifications
You must be signed in to change notification settings - Fork 28
Tips and Tutorials
Also see the video and slides from our 2016 PSU MacAdmins presentation, "Writing better AutoPkg recipes with the help of Recipe Robot."
My goal is not to make Recipe Robot generate perfect recipes 100% of the time. There will be apps that Recipe Robot may not be able to generate recipes for, and some recipe types are more complex to build than others. I hope Recipe Robot will make the process of writing recipes for simple apps much faster and more consistent. The recipes created by Recipe Robot should serve as a platform that you can customize before using and sharing.
You may still need to make a recipe the old fashioned way, if the Robot comes up empty.
By default, Recipe Robot does not generate recipes for an app if any AutoPkg recipes already exist for that app. This is a design choice we made after careful consideration, for two reasons:
-
It's difficult to parse a ParentRecipe and determine exactly which processors will be needed and which file paths we can rely on. Your brain is still the best tool for that.
-
Many AutoPkg recipe authors put a lot of work into creating and maintaining their recipes, and it's important that we respect that by refraining from uploading duplicate recipes to GitHub.
You can override this etiquette, but please only post a duplicate set of recipes to GitHub if they meet these guidelines:
- applicable to a wide audience
- better than the original in at least one significant way
- a note in the description clarifies how your recipe differs (see this example)
Thank you!
Each time Recipe Robot produces a batch of recipes for you, I suggest you check a few things before letting the recipes loose in the wild:
-
The filename of the recipe and the
NAME
input variable are determined by the name of the app itself. Many apps are suffixed with a version number (e.g. "Delicious Library 3"), and that version number may not be desirable in all cases. You may need to remove the version number from the filename, recipe identifiers, andParentRecipe
keys. -
Recipe Robot doesn't currently know the difference between an app installer and a bona fide app. Therefore, certain apps may produce recipes that simply install the app's installer instead of the app itself. When this happens, it's usually pretty obvious because you'll end up with a set of recipes called, for example,
ChronoSync Installer.___.recipe
instead ofChronoSync.___.recipe
. The download recipe is probably usable, but the others will need significant customization. -
Recipe Robot does its best at determining an app's description for use in Munki and JSS recipes. But it's far from perfect, and it will surprise you with false positives! Always double-check the description before running Munki and JSS recipes or uploading them to GitHub.
-
It's fine to use a version-specific URL as input, but be careful that it doesn't result in download recipes that depend upon it. Such recipes will not serve the purpose of downloading the latest version using AutoPkg.
You may need to try again with a different URL (preferably one like
http://foo-app.com/latest
orhttp://downloads.pretendco.com/Foo.zip
which doesn't point to a specific version).Or you may want to explore using URLTextSearcher to determine the latest URL by inspecting the source of the developer's download page.
If you provide Recipe Robot with the path to an app that came from the Mac App Store, it will create an override for use with Nick McSpadden's AppStoreApp recipes. Please see the details in his README for requirements necessary to use these overrides.
If all you need to do is to build a JSS recipe that uses an existing pkg recipe as its parent, you may want to check out JSSRecipeCreator, which can build both conventional (*.jss.recipe) and "package only" (*.jss-upload.recipe) type recipes. Recipe Robot is not designed to create child recipes for existing parent recipes, although with some tweaking you can certainly use it that way.