autopkg and munki on Os X Server 10.8.5
prereq
- git
- munki_repo
- munkitools (latest)
install autopkg
install pkg from here
https://github.com/autopkg/autopkg/releases
Configure autopkg
setup munki_repo
defaults write com.github.autopkg MUNKI_REPO /path/to/munki_repo
defaults read com.github.autopkg MUNKI_REPO
/Volumes/DEPLOY_IMAGES/DEPLOYBUILDS_DEV/MUNKI_REPO_MASTER
When following wiki, all goes in your home directory, there are other options with defaults :
defaults write com.github.autopkg CACHE_DIR ~/Library/AutoPkg/Cache
defaults write com.github.autopkg RECIPE_SEARCH_DIRS ~/Library/AutoPkg/Recipes
defaults write com.github.autopkg RECIPE_OVERRIDE_DIRS ~/Library/AutoPkg/RecipeOverrides
defaults write com.github.autopkg RECIPE_REPO_DIR ~/Library/AutoPkg/RecipeRepos
I choosed to trick and put everything in /Library/autopkg. I then did symlinks in my home directory
ln -s /Library/AutoPkg/Cache ~/Library/AutoPkg/Cache
ln -s /Library/AutoPkg/RecipeRepos ~/Library/AutoPkg/RecipeRepos
Add recipes
autopkg repo-add http://github.com/autopkg/recipes.git
autopkg list-recipes
autopkg info Firefox.munki
autopkg run -v Firefox.munki.recipe
autopkg run -v Firefox.munki.recipe MakeCatalogs.munki
Note :
Adding MakeCatalogs.munki at the end of the autopkg run will make the munki catalogsā¦
autopkg run -v AdobeFlashPlayer.munki Cyberduck.munki Skype.munki TextWrangler.munki TheUnarchiver.munki MakeCatalogs.munki
went well.
The following new items were downloaded:
/Volumes/INTRAID500/Users/localadminoem/Library/AutoPkg/Cache/com.github.autopkg.munki.FlashPlayerNoRepackage/downloads/AdobeFlashPlayer.dmg
/Volumes/INTRAID500/Users/localadminoem/Library/AutoPkg/Cache/com.github.autopkg.munki.Cyberduck/downloads/Cyberduck-11010.tar.gz
/Volumes/INTRAID500/Users/localadminoem/Library/AutoPkg/Cache/com.github.autopkg.munki.Skype/downloads/Skype.dmg
/Volumes/INTRAID500/Users/localadminoem/Library/AutoPkg/Cache/com.github.autopkg.munki.textwrangler/downloads/TextWrangler_4.5.3.dmg
/Volumes/INTRAID500/Users/localadminoem/Library/AutoPkg/Cache/com.github.autopkg.munki.TheUnarchiver/downloads/TheUnarchiver.zip
The following new items were imported:
Name Version Catalogs Pkginfo Path
---- ------- -------- ------------
AdobeFlashPlayer 11.8.800.168 testing internet_plugins/AdobeFlashPlayer-11.8.800.168.plist
Cyberduck 4.3.1 testing apps/Cyberduck-4.3.1.plist
Skype 6.9 testing apps/Skype-6.9.plist
TextWrangler 4.5.3 testing apps/TextWrangler/TextWrangler-4.5.3.plist
TheUnarchiver 3.9.1 testing apps/TheUnarchiver-3.9.1.plist
autopkg overides
autopkg run --help
Usage: autopkg run [options] [recipe ...]
Run one or more recipes.
Options:
-h, --help show this help message and exit
-c, --check Only check for new/changed downloads.
-k KEY=VALUE, --key=KEY=VALUE
Provide key/value pairs for recipe input. Caution: values specified here will be applied to all recipes.
-l TEXT_FILE, --recipe-list=TEXT_FILE
Path to a text file with a list of recipes to run.
-p PKG_OR_DMG, --pkg=PKG_OR_DMG
Path to a pkg or dmg to provide to a recipe.
Downloading will be skipped.
--report-plist
Output run report data in plist format to stdout.
Additional messages may still be printed to stderr.
-v, --verbose
Verbose output.
-d DIRECTORY, --search-dir=DIRECTORY
Directory to search for recipes. Can be specified multiple times.
--override-dir=DIRECTORY
Directory to search for recipe overrides. Can be specified multiple times.`
autopkg info
Current preferences:
{'MUNKI_REPO': u'/Volumes/DEPLOY_IMAGES/DEPLOYBUILDS_DEV/MUNKI_REPO_MASTER',
'RECIPE_REPOS': {u'/Library/AutoPkg/RecipeRepos/com.github.Jaharmi.autopkg_recipes': {
URL = "https://github.com/Jaharmi/autopkg_recipes";
},
u'/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes': {
URL = "http://github.com/autopkg/recipes.git";
}},
'RECIPE_SEARCH_DIRS': [u'/Library/AutoPkg/Recipes',
u'/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes',
u'/Library/AutoPkg/RecipeRepos/com.github.Jaharmi.autopkg_recipes']}
Example for jenkins
/usr/local/bin/autopkg run --search-dir=DIRECTORY --override-dir=DIRECTORY VLC.munki
Notes :
Adding run –key
- –search-dir=DIRECTORY
Adding full autopkg path
- /usr/local/bin/autopkg
Command examples:
/usr/local/bin/autopkg run -v --search-dir=/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes/ AdobeFlashPlayer.munki MakeCatalogs.munki
/usr/local/bin/autopkg run -v --search-dir=/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes/Cyberduck.munki
Working !
EDIT : Next jenkins setupā¦
jenkins local scripts, Autopkg & munki
Usefull Links :
https://github.com/autopkg/autopkg/wiki#introduction
https://groups.google.com/forum/#!topic/autopkg-discuss/YcQSyXL7DRg
[…] autopkg on Os X Server 10.8.5 | oemden says: 2013/10/27 at 21:19 […]