CI/CD Environment

How to use the Popul8 CLI in a CI/CD environment

This guide shows how to automate Popul8 in GitLab CI with a windows runner.

Prerequisites

  • A GitLab Runner on Windows (Shell or PowerShell executor), tagged (e.g., windows).
  • Popul8 installed on the Windows runner (e.g., C:\Program Files x86\Popul8\Popul8.exe or the default install path).
  • popul8-cli.exe available in PATH, or use its absolute path in scripts.
  • A valid license file accessible by the runner.

Environment variables (recommended)

Define the following variables in GitLab CI settings (masked/protected as needed):

  • POPUL8_PATH: Path to Popul8 application, e.g., C:\\Program Files x86\\Popul8\\Popul8.exe
  • POPUL8_LICENSE_PATH: Path to license file, e.g., C:\\builds\\licenses\\license.bin
  • POPUL8_PORT: Port, e.g., 2055.
  • POPUL8_PROJECT_PATH: Path to .pp8 project file.
  • POPUL8_EXPORT_DIR: Export output directory.
  • POPUL8_VERIFY_DIR: Verify output directory.

General CI flow

  1. Start Popul8
  2. Configure license (if needed) or verify license status
  3. Open a project (.pp8)
  4. Export or Verify
  5. Collect artifacts
  6. Stop Popul8

Windows GitLab CI example

The example below uses a Windows Shell/PowerShell runner. Adjust paths, tags, and variables to your environment.

stages:
  - export
  - verify

.variables_base: &variables_base
  POPUL8_CLI: "C:\\Program Files (x86)\\Popul8\\popul8-cli.exe"
  POPUL8_PATH: "C:\\Program Files (x86)\\Popul8\\Popul8.exe"
  POPUL8_LICENSE_PATH: ""
  POPUL8_PORT: "2055"
  POPUL8_PROJECT_PATH: "$CI_PROJECT_DIR\\DemoExpress.pp8"
  POPUL8_EXPORT_DIR: "$CI_PROJECT_DIR\\export_results"
  POPUL8_VERIFY_DIR: "$CI_PROJECT_DIR\\verify_results"

.default_windows: &default_windows
  tags: ["windows"]
 
export_assets:
  stage: export
  <<: *default_windows
  variables:
    <<: *variables_base
  script:
    - |
      "$POPUL8_CLI" --version
      "$POPUL8_CLI" start "$POPUL8_PATH" -p "$POPUL8_PORT" --gui
      echo "Popul8 started"
      echo "Setting license..."
      "$POPUL8_CLI" license "$POPUL8_LICENSE_PATH" -p "$POPUL8_PORT"
      echo "Opening project..."
      "$POPUL8_CLI" open "$POPUL8_PROJECT_PATH" -p "$POPUL8_PORT"
      echo "Project opened"
    - |
      echo "Creating export directory..."
      mkdir -p "$POPUL8_EXPORT_DIR"
      echo 'Exporting assets...'
      "$POPUL8_CLI" export "$POPUL8_EXPORT_DIR" -p "$POPUL8_PORT"
      echo "Export completed"
    - |
      echo "Stopping Popul8..."
      "$POPUL8_CLI" stop -p "$POPUL8_PORT"
  artifacts:
    when: always
    expire_in: 1 week
    paths:
      - export_results/
  rules:
    - when: on_success

verify_assets:
  stage: verify
  <<: *default_windows
  variables:
    <<: *variables_base
  script:
    - |
      "$POPUL8_CLI" --version
      "$POPUL8_CLI" start "$POPUL8_PATH" -p "$POPUL8_PORT" --gui
      echo "Popul8 started"
      echo "Setting license..."
      "$POPUL8_CLI" license "$POPUL8_LICENSE_PATH" -p "$POPUL8_PORT"
      echo "Opening project..."
      "$POPUL8_CLI" open "$POPUL8_PROJECT_PATH" -p "$POPUL8_PORT"
      echo "Project opened"
    - |
      echo "Creating verify directory..."
      mkdir -p "$POPUL8_VERIFY_DIR"
      echo "Verifying assets..."
      "$POPUL8_CLI" verify "$POPUL8_VERIFY_DIR" -p "$POPUL8_PORT" --scope templates -v
      echo "Verification completed"
    - |
      echo "Stopping Popul8..."
      "$POPUL8_CLI" stop -p "$POPUL8_PORT"
  artifacts:
    when: always
    expire_in: 1 week
    paths:
      - verify_results/
  rules:
    - when: on_success

Notes

  • If Popul8 is not found or fails to start, start will fail; ensure POPUL8_PATH is correct or use auto with a previously saved config (popul8-cli config --popul8path).
  • On Windows, long paths require quoting ("C:\path with spaces\file.pp8").
  • license without a path shows current status; provide a path to set/update.
  • Use separate jobs for export and verify to keep artifacts isolated.