Skip to content

Commit

Permalink
Adding jamf recipe for Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
smithjw committed Nov 24, 2021
1 parent efa7af1 commit 0452099
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 35 deletions.
44 changes: 22 additions & 22 deletions Xcode/Xcode.extract.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ Input:
NAME: Xcode

Process:
- Processor: XcodeXIPUnpacker
Arguments:
PKG: '%RECIPE_CACHE_DIR%/%NAME%-%version%.xip'
output_path: '%RECIPE_CACHE_DIR%/extract'
- Processor: XcodeXIPUnpacker
Arguments:
PKG: '%RECIPE_CACHE_DIR%/%NAME%-%version%.xip'
output_path: '%RECIPE_CACHE_DIR%/%NAME%'

- Processor: FileFinder
Arguments:
pattern: '%RECIPE_CACHE_DIR%/extract/*.app'
- Processor: FileFinder
Arguments:
pattern: '%RECIPE_CACHE_DIR%/%NAME%/*.app'

- Processor: CodeSignatureVerifier
Arguments:
input_path: '%found_filename%'
requirement: identifier "com.apple.dt.Xcode" and anchor apple
- Processor: CodeSignatureVerifier
Arguments:
input_path: '%found_filename%'
requirement: identifier "com.apple.dt.Xcode" and anchor apple

- Processor: PlistReader
Arguments:
info_path: '%found_filename%/Contents/version.plist'
plist_keys:
CFBundleShortVersionString: version
CFBundleVersion: bundle_version
ProductBuildVersion: build_version
- Processor: PlistReader
Arguments:
info_path: '%found_filename%/Contents/version.plist'
plist_keys:
CFBundleShortVersionString: version
CFBundleVersion: bundle_version
ProductBuildVersion: build_version

- Processor: XcodeVersioner
Arguments:
app_path: '%found_filename%'
version: '%version%'
- Processor: XcodeVersioner
Arguments:
app_path: '%found_filename%'
version: '%version%'
46 changes: 46 additions & 0 deletions Xcode/Xcode.jamf.recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Description: Downloads the latest version and makes a pkg. Then, uploads the package to the Jamf Pro Server and creates a Self Service Policy and Smart Group.
Identifier: com.github.smithjw.jamf.xcode
ParentRecipe: com.github.smithjw.pkg.Xcode
MinimumVersion: '2.3'

Input:
NAME: Xcode
CATEGORY: Developer
GROUP_NAME: '%NAME%-update-smart'
GROUP_TEMPLATE: SmartGroup-update-smart-regex.xml
TESTING_GROUP_NAME: Testing
POLICY_CATEGORY: Testing
POLICY_TEMPLATE: Policy-install-latest.xml
POLICY_NAME: 'Install Latest %NAME%'
POLICY_RUN_COMMAND: 'chown -R "$(stat -f%Su /dev/console):staff" "/Applications/%NAME%.app" && echo "Corrected permissions for %NAME%."'
SELF_SERVICE_DISPLAY_NAME: 'Install Latest %NAME%'
SELF_SERVICE_DESCRIPTION: 'Xcode includes everything developers need to create great applications for Mac, iPhone, iPad, Apple TV, and Apple Watch.'
SELF_SERVICE_ICON: '%NAME%.png'
SOFTWARE_TITLE: '%NAME%'
INSTALL_BUTTON_TEXT: 'Install'
REINSTALL_BUTTON_TEXT: 'Install'
UPDATE_PREDICATE: 'pkg_uploaded == False'

Process:
- Processor: com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader
Arguments:
category_name: '%CATEGORY%'

- Processor: com.github.grahampugh.jamf-upload.processors/JamfPackageUploader
Arguments:
pkg_category: '%CATEGORY%'

- Processor: StopProcessingIf
Arguments:
predicate: '%UPDATE_PREDICATE%'

- Processor: com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader
Arguments:
computergroup_template: '%GROUP_TEMPLATE%'
computergroup_name: '%GROUP_NAME%'

- Processor: com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader
Arguments:
policy_template: '%POLICY_TEMPLATE%'
policy_name: '%POLICY_NAME%'
icon: '%SELF_SERVICE_ICON%'
25 changes: 12 additions & 13 deletions Xcode/Xcode.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ Input:
NAME: Xcode

Process:
- Processor: PkgRootCreator
Arguments:
pkgroot: '%RECIPE_CACHE_DIR%/%NAME%'
pkgdirs:
Applications: '0775'
- Processor: FileMover
Arguments:
source: '%found_filename%'
target: '%RECIPE_CACHE_DIR%/%NAME%/Applications/%NAME%-%major_version%.%minor_version%.app'

- Processor: FileMover
Arguments:
source: '%found_filename%'
target: '%RECIPE_CACHE_DIR%/Xcode/Applications/%NAME%-%major_version%.%minor_version%.app'
- Processor: DmgCreator
Arguments:
dmg_path: '%RECIPE_CACHE_DIR%/%NAME%-%major_version%.%minor_version%.dmg'
dmg_root: '%RECIPE_CACHE_DIR%/%NAME%'

- Processor: DmgCreator
Arguments:
dmg_path: '%RECIPE_CACHE_DIR%/%NAME%-%major_version%.%minor_version%.dmg'
dmg_root: '%RECIPE_CACHE_DIR%/%NAME%'
- Processor: PathDeleter
Arguments:
path_list:
- '%RECIPE_CACHE_DIR%/%NAME%'

0 comments on commit 0452099

Please sign in to comment.