Skip to content

Setup sync auto update

Chris Lasell edited this page Mar 19, 2016 · 1 revision

Sync and Auto Updates

The primary goal of d3 is to automatically deploy updates and patches to installed packages. d3 does this during the 'sync' process.

Lets test it out.

First we need to add a new version of our package to d3. For testing you can use the same source .pkg or .dmg that you used in Adding your first package

This time, lets use d3admin in command-line mode rather than walkthru mode. There are many options available to set the properties of the new package from the command-line, but since the package will inherit properties from the earlier one, we will only use one:

% d3v3admin add firsttest  --source-path /Users/chrisl/dev/d3roots/MyTestPkg.pkg 
Adding a new pilot package to d3...

******* New d3 Package Settings *******
Edition: firsttest-1-2
Basename: firsttest
Version: 1
Revision: 2
JSS Package Name: firsttest-1-2
Description: 
----
This is descriptive of the first test package.
----
Dist. Point Filename: firsttest-1-2.pkg
Category: d3-package
Limited to OS's: none
Limited to CPU type: None
Needs Reboot: false
Uninstallable: true
Uninstalls older installs: false
Installation prohibited by processes matching: none
Auto installed for groups: none
Not installed for groups: none
Pre-install script: none
Post-install script: none
Pre-uninstall script: none
Post-uninstall script: none
Expration: 0
Expration Path: none
Source path: /Users/chrisl/dev/d3roots/MyTestPkg.pkg
Package build workspace: /Users/chrisl/dev/d3roots
Package build type: pkg
Package identifier prefix: com.pixar.d3.chrisltest
Preserve ownership in .pkg: false

*****************************************
Ahoy there! You are about to:
Create a new package 'firsttest-1-2' in d3
with settings shown above.
*****************************************

Are you SURE? (y/n): y
Saving new pilot firsttest-1-2 to the server...
Indexing...
Uploading to the Master Distribution Point...
Done!
To pilot it, run 'sudo d3 install firsttest-1-2' on a test machine.
To make it live, run 'd3admin live firsttest-1-2' on your machine.

You can now use d3admin search to see that it's on the server and in pilot:

#------' ' next, 'b' prev, 'q' exit, 'h' help ------
# All packages in d3
# Edition     Status     Added      By        Released   By        
#--------------------------------------------------------------
firsttest-1-1 live       2016-03-10 chrisl    2016-03-10 chrisl    
firsttest-1-2 pilot      2016-03-10 chrisl    -          -  

In real life you would now test firsttest-1-2 on a few machines. Then when you're happy with it, you can make it live with d3admin live firsttest-1-2 like you did with firsttest-1-1 earlier.

Go ahead and do that now. That will make firsttest-1-2 be the currently live edition of firsttest.

% d3v3admin live firsttest-1-2

*****************************************
Ahoy there! You are about to:
Make firsttest-1-2 live for basename 'firsttest'
*****************************************

Are you SURE? (y/n): y
Done!
New installs of basename 'firsttest' will get 1-2
Existing installs will be updated at the next d3 sync.

% d3v3admin search
#------' ' next, 'b' prev, 'q' exit, 'h' help ------
# All packages in d3
# Edition     Status     Added      By        Released   By        
#--------------------------------------------------------------
firsttest-1-1 deprecated 2016-03-10 chrisl    2016-03-10 chrisl    
firsttest-1-2 live       2016-03-10 chrisl    2016-03-10 chrisl  

Now that the new one is live, lets see what happens when we run sudo d3 sync on a client

% sudo d3 sync 
Starting sync
Updating receipts
Checking for invalid puppies in the queue
Checking for updates to installed packages
Installing: firsttest-1-2 (live)
Updated firsttest-1-1 to firsttest-1-2
Checking for new pkgs to auto-install
Starting expiration check
Finished sync

Updated!

The d3 sync command can be run at any time by an admin who wants to get things in sync. However it's power comes from running it automatically at a decent interval, either with a Casper policy or a LaunchDaemon installed on the client computers.