RevInfo

What is RevInfo?

RevInfo automatically creates Git commit data and Automation Studio build information in a variable declaration file you can use within your Automation Studio project.
It makes clear what committed version of code is running and who transferred it (+when!) to ensure you’ll never walk away from a machine with uncommitted code, ever again.
Automation Studio variable file with Git information

Download

The download below is a package which can be imported directly into an Automation Studio project via File -> Import.

RevInfo Download: RevInfo.zip - Version 1.0.0

RevInfo Walk Through and Git Tutorials

RevInfo Walk Through: Using RevInfo (6:20) - Step by Step importing RevInfo into Automation Studio, adding it to your project, and configuring Git.

New to Git and Automation Studio? Git for PLCs is Loupe’s video series on using Automation Studio and version control with Git.

Documentation & Use

Documentation is commented within the getRevInfo.sh script as well.

  1. RevInfo requires a prebuild option, configured in Automation Studio, in each configuration to retrieve status information from Git and Automation Studio.

    Navigate via: Project (Menu) -> Change Runtime Version (dropdown) -> Build Events (tab) -> Prebuild (field)

    The following line should be pasted into the pre-build step of each configuration that should run this script:

    "$(AS_PROJECT_PATH)\Logical\RevInfo\getRevInfo.sh" "$(AS_PROJECT_PATH)\Logical\RevInfo" "$(AS_CONFIGURATION)" "$(AS_USER_NAME)"
    
  2. Add an empty RevInfo.var to the RevInfo package in Automation Studio, if it doesn’t already exist.

  3. Add *RevInfo.var to your .gitignore file.

  4. Ensure that .sh files are executed by Git by default.

    Navigate to the folder that contains this .sh file -> Right Click -> Open With -> Choose another app -> Select Git and check the ‘Always use this app to open .sh files’ box