Issues.00566 - lordmundi/wikidoctest GitHub Wiki

00566: add WCS information to show USERDATA version information

« 00565 | Issues | 00567 »

Summary: add WCS information to show USERDATA version information

Created: 2016–04–06 14:30

Status: Released

Category: Request

From: frankie

Version: 2.3

Released_In: 2.4

Description:

being able to detect EDGE version information remotely via the WCS is very useful, but so much is customizable via the USERDATA mechanism that it is often tracked and versioned as a project on its own.

This is a request for the USERDATA to be able to advertise through WCS version information about itself.


Comments

frankie April 06, 2016, at 04:28 PM: This has been done. The following environment variables will be shown via WCS on the "/status" resource page as well as a new resource at "/edge_userdata_info":

  • EDGE_USERDATA_NAME
  • EDGE_USERDATA_VERSION
  • EDGE_USERDATA_HASH

You can obviously set these variables however you like. You could do so via the "DEFINES" block in your user.cfg, or via shell environment variables from your startup script. An example implementation in csh might look something like:

if (-f EDGE_USERDATA_NAME) then
    setenv EDGE_USERDATA_NAME `cat EDGE_USERDATA_NAME`
    echo "EDGE_USERDATA_NAME is $EDGE_USERDATA_NAME"
endif

if (-f EDGE_USERDATA_VERSION) then
    setenv EDGE_USERDATA_VERSION `cat EDGE_USERDATA_VERSION`
    echo "EDGE_USERDATA_VERSION is $EDGE_USERDATA_VERSION"
endif

if (-d .git) then
    setenv EDGE_USERDATA_HASH `git rev-parse HEAD`
    echo "EDGE_USERDATA_HASH is $EDGE_USERDATA_HASH"
endif
echo ""

This retrieves the _NAME and _VERSION from files that can be updated easily and also retrieves the hash from git, assuming the userdata is stored in a git repo along with the run script running the above code.

As part of this feature, the WCS version will be updated.


« 00565 | Issues | 00567 »

Associated Commits

| commit | 7901110d6b1c0604adb1830c79d90a1380d6be36 link5 | || | Author: | Frank Graffagnino | | Date: | Wed Apr 6 16:50:21 2016 -0500 | | Message: | [@Issue 00566: Added EDGE USERDATA version information to WCS The following environment variables will be shown via WCS on the "/status" resource page as well as a new resource at "/edge_userdata_info":

  • EDGE_USERDATA_NAME
  • EDGE_USERDATA_VERSION
  • EDGE_USERDATA_HASH

You can obviously set these variables however you like. You could do so via the "DEFINES" block in your user.cfg, or via shell environment variables from your startup script. @] |

Affected Files:

gui/html/lte_edge_root.xsl                | 26 +++++++++++++++++++++
 gui/html/templates/xml_status.tmpl        | 10 ++++++++
 gui/html/templates/xml_userdata_info.tmpl | 16 +++++++++++++
 gui/web_commanding_server.tcl             | 39 +++++++++++++++±--------------
 4 files changed, 72 insertions(+), 19 deletions(-)