A number of macOS versions are already packaged and ready to be deployed from Addigy's Public Software Catalog. If you need to install a version of macOS not already available in Addigy, here are some short steps to get you started.           

Download the Install macOS app from the AppStore.   

Compress the macOS Install App into a tar file:

cd "/Applications" 
tar -czvf ~/Desktop/macOS_Sierra.tar.gz "Install macOS Sierra.app"

Upload the tar file, ie. 'macOS_Sierra.tar.gz', into a Custom Software in Addigy. Then simply add this Installation script:

# Uncompress the compressed installer.
tar -zxvf macOS_Sierra.tar.gz -C /Applications/

# Make sure the installer has the appropriate file permissions.
chmod -R 755 "/Applications/Install macOS Sierra.app"

# This is the command the installs the new version.
"/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall" --applicationpath "/Applications/Install macOS Sierra.app" --agreetolicense --nointeraction

There are many ways to make the process more specific. For instance, you may need to add a command at the beginning of your Installation script to download the file from your own file servers. Also, the device will need to restart as soon as the upgrade is complete. You can use Addigy notifications to the end-user to assist them in restarting their device. Learn more about our notifications in the article Prompting End-Users with Notifications.

Additionally, we recommend you take a look at the usage of the startosinstall command's other options. You can run this command to see many more settings when performing the upgrade.

"/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall" --usage