Skip to main content

Baseline Builder

Python-based tooling for generating Baseline packages, for streamlining package building of multiple clients. Designed for easier CI/CD integration with Python 3.


Features implemented:

  • Resolves local files such as scripts, packages and images to Baseline packaging
    • Scans in same directory as invocation script
  • Calculates MD5 for scripts and packages
  • Determines Team ID for local packages
  • Easy imports for chaining into larger CI/CD workflows
  • Validates existing packages

Logic

Baseline Builder works by taking configuration files for Baseline, and generating a package for deployment. If scripts, packages or images are declared in the file, Baseline Builder will attempt to resolve them and embed inside the package.

  • See Baseline's documentation on how to configure: Baseline Wiki
  • If an mobileconfig is provided as input, a resolved version will be written next to the package.
    • As the mobileconfig method is meant to be used, no BaselineConfig.plist is embedded in the package.

Example configuration can be found in the Samples directory. Below is pulled from RIPEDA Engineering configuration:

<key>Packages</key>
<array>
  <dict>
    <key>DisplayName</key>
    <string>Printer</string>
    <key>PackagePath</key>
    <string>Assets/Packages/Printer.pkg</string>
    <key>Icon</key>
    <string>Assets/Icons/Printer.png</string>
  </dict>
</array>

The project will attempt to resolve the PackagePath and Icon keys through scanning the local directory:

Baseline Builder Directory:
- client.plist
- Assets:
  - Packages:
    - Printer.pkg
  - Icons:
    - Printer.png

Installation

pip3 install baseline-builder

Usage

Building

import baseline

baseline_obj = baseline.BaselineBuilder(
                    configuration_file="ripeda.plist",
                    identifier="com.ripeda.baseline.engineering",
                    version="1.0.0",
                    output="RIPEDA Baseline.pkg"
                )

baseline_obj.build()

print("Package built successfully")

After a build is complete, optional .validate_pkg() can be invoked to decompress and validate the package contents automatically.

Validating existing packages via command line

For quick validation of existing packages, the -v/--validate flag can be used to decompress and validate the package contents automatically. If the package lacks a BaselineConfig.plist, a mobileconfig can be provided to validate against.

# Validate package with mobileconfig
python3 baseline.py --validate "RIPEDA.pkg" ripeda.mobileconfig

# Validate package without config (embedded in pkg)
python3 baseline.py --validate "RIPEDA.pkg"
# Example Output
$ python3 baseline.py --validate RIPEDA.pkg

Performing post-build validation...
Validating configuration file...
    Validating Icon: Zoom.icns...
    Validating Installomator label: zoom...
    Validating Icon: Chrome.icns...
    Validating Installomator label: googlechromepkg...
    Validating PackagePath: Printer.pkg...
    Calculating MD5 for: Printer.pkg...
    Determining Team ID for: Printer.pkg...
    Validating Icon: Scripts-Printer.png...
    Validating ScriptPath: universal_remove_stock_apps.sh...
    Calculating MD5 for: universal_remove_stock_apps.sh...
    Validating Icon: Scripts-Stock-Apps.png...
    Validating ScriptPath: universal_dock.sh...
    Calculating MD5 for: universal_dock.sh...
    Validating Icon: Scripts-Dock.png...
Configuration file is valid.
Post-build validation complete.

Metadata

Release files for baseline-builder 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for baseline-builder 1.7.1
File Interpreter ABI Platform
baseline_builder-1.7.1-py3-none-any.whl Python 3 none any Details

Release files / baseline_builder-1.7.1-py3-none-any.whl

Download URL baseline_builder-1.7.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10c6d8d128a406fbf39d18fbbd56be610e799db8fcb6ae8d7380437361d4f641
BLAKE2b-256 checksum
How to use checksums
73773c57a0731ee0b5fca3a9c8c200de6f9c114b7047f50de6514e51c5b04d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.7.1 This release

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.8

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page