About

Web File Validator Trigger using HTML Tidy
  • 1
    Member
  • 0
    Followers
  • 1
    Branch
Owners
tom_tyler (C. Thomas Tyler)
Members
tom_tyler (C. Thomas Tyler)
Followers
Branches
  • Main

Web File Validator using Tidy

Overview

This provides a Helix Server pre-commit (change-content) trigger that validates web fles upon attempted submit, and rejects those that fail validation.

Validation of web content is done using tidy HTML Tidy.

This is installed with a Perforce Triggers table entry like the following:

<PRE>

Triggers:

wfv_tidy change-content //path/... "/p4/common/bin/triggers/wfv_tidy.sh %changelist%"

</PRE>

Web Files

Files with .html and .inc extensions are considered web files.

Dependencies

Dependencies:

  • The /bin/bash be bash 4.0 or greater.
  • The 'tidy' utility must be installed and available in the PATH. A tidy package is available on many moder OS distributions, including Mac and Linux.
  • The 'p4' executable installed and available in the PATH.
  • The Helix Server connection settings (P4PORT, P4USER) and a valid ticket must exist.

It is recommend this be deployed along with the Perforce Server Deployment Package, though there is no hard dependency.

Installation

Install the bash shell script on your server, and confiure a Triggers table entry to call it, as per the example above.