-
Notifications
You must be signed in to change notification settings - Fork 13
Customize
As detailed in "How it works" Outset runs script and packages from a set of defined processing folders located at /usr/local/outset/
. There are a number of options for getting your content into these folders
AutoPKG -> OutsetPayloadPkgReqd
If you're new to packaging and you want to learn all the nitty gritty you can buy this ebook: https://scriptingosx.com/packaging-for-apple-administrators/
There is also the #packaging
channel on the MacAdmins Slack for discussion and asking questions around packaging.
Outset 4 comes with a small utility script to help package your outset workflow items into a deployable package.
This is intended as a starting point to creating packages specifically for outset and does not replace any existing packaging workflows you may already be using.
/usr/local/outset/Outset.app/Contents/Resources/outset-pkg
outset-pkg
does not perform any signing or notarization tasks so you will need to take this into account if that is required. Most software management tools can deploy and install unsigned packages but check with your vendor.
Check the --help
for available arguments and options if they differ from what is presented here
OVERVIEW: outset-pkg is a utility that packages files for use in outset workflows.
USAGE: outset-pkg --all [<options>] | --file <filename> [<options>]
OPTIONS:
-a, --all Package all scripts from outset processing directories into one package
-f, --file <filename> Package the selected file
-x, --make-executable Ensure the selected file executable bit is set (only applies to script files)
-t, --target <directory> Target processing directory (default 'login-once')
-s, --postinstall-script [<filename>]
Include a postinstall script. If no argument is given, a standard postinstall
script to trigger on-demand will be included.
-v, --version, <number> Set package version to the selected number (default is '1.0')
-p, --build-path, <path> Path to use as the build location (default /var/tmp/outset)
-h, --help Print this message
Requires one of --file <path> [--target <directory>]
OR --all
To package an individual script you need at minimum a --file
to package.
./outset-pkg --file /path/to/some/script.sh
This will create /var/tmp/outset/outset-login-once-script.sh_v1.0.pkg
which install the script.sh
file to /usr/local/outset/login-once/
For use with the --file
option.
Builds the package with the specified deployment target directory. Valid arguments are:
- boot-every
- boot-once
- login-every
- login-once
- login-privileged-every
- login-privileged-once
- login-window
- on-demand
./outset-pkg --file /path/to/some/script.sh --target login-privileged-every
Instead of building packages one by one for each single specified file, --all
will build a single package using all of the processing directories and their contents in a local copy of /usr/local/outset/
. Simply copy all your content to these folders locally.
Use this option if you want to deploy your entire outset workflow in one package (the main outset binary package should be deployed seperatly)
./outset-pkg -a
pkgbuild: Inferring bundle components from contents of /var/tmp/outset/PGKROOT
pkgbuild: Wrote package to /var/tmp/outset/outset-custom-content_v1.0.component.pkg
productbuild: Wrote product to /var/tmp/outset/outset-custom-content_v1.0.pkg
Package has been created at /var/tmp/outset/outset-custom-content_v1.0.pkg
Use with either --file
or -a
Will build the resulting package in the specified path.
./outset-pkg --file /path/to/some/script.sh --build-path ~/Documents
Will save the built package to your Documents folder.
Specify the version of the package, e.g. 1.1
, 1.2.3.4
.
Non numerical version numbers like 1.0a
are not supported and will result in an error.
./outset-pkg --file /path/to/some/script.sh --version 0.1
Prints usage text
Copy your custom packages and scripts to their respective working directories in the included custom-outset
directory, and remove the example scripts.
Make sure any scripts you are adding have the executable bit. You may have to run chmod +x ./path/to/script.sh
to set this. The following makefile package building process should ensure your scripts are owned by root (UID 0) when the payload installs them to the disk (specific group membership is not required/checked, but outset does confirm the writable bit is NOT set on your scripts).
Note: The login context runs as the user, so you won't be able to install pkgs by putting them in login-once
or login-every
. If you cannot use the boot contexts for pkgs for any reason, add your packages or scripts to the login-privileged-once
or login-privileged-every
directories, and they will be processed as root when the user logs in.
After you've added your custom packages and scripts, and removed the example scripts, change directories to custom-outset
and open the Makefile in a Text Editor.
Edit the top 4 lines to change them from..
PKGTITLE="outset-custom"
PKGVERSION="1.0.0"
PKGID=com.github.outset.custom
PROJECT="outset-custom"
..to your own information:
PKGTITLE="super-scripts"
PKGVERSION="1.1.0"
PKGID=com.github.super.scripts
PROJECT="super-scripts"
Save the Makefile and then use it to package up your files:
$ cd ./name-of-custom-outset
$ make pkg
This will then display the following output:
rm -f ./outset*.pkg
rm -f ./pkgroot/usr/local/outset/*/*.pyc
pkgbuild --root pkgroot --identifier com.github.outset.custom --version "1.0.0" --ownership recommended ./"outset-custom"-"1.0.0".pkg
pkgbuild: Inferring bundle components from contents of pkgroot
pkgbuild: Wrote package to ./outset-custom-1.0.0.pkg
You will see a package called outset-custom-{VersionNumber}.pkg
where "VersionNumber" is what is defined in the Makefile.
You can use this package with a management suite such as Munki or Jamf.