Seek tools for text document variable substitution from a key / value input file ?

27 views
Skip to first unread message

Eddie Sutton

unread,
Aug 17, 2015, 10:11:33 AM8/17/15
to jenkins...@googlegroups.com
I am looking for tools to automatically update text documents with relevant build information such as version information, date of build, the new features included with a milestone.

SubWCRev works well but is limited to Subversion properties:


ReadMe Template File:
-------------------------------
Build date: $WCDATE$


I am looking for a tool could read an input text file containing key value pairs, and substitute variables in a document template for HTML files, readme.txt files, RSS news feed files, etc.


Input File (Manually Maintained)
-------------------------------------------
ReleaseSummary="New Features and Bug Fixes"
Feature1="Cure for cancer"


Output Template File:
-----------------------------
<h1>$ReleaseSummary$<h1>
<a href="$DownloadUrl$" >Download</a>

Thanks in advance for any suggestions,

-Ed

Daniel Beck

unread,
Aug 17, 2015, 10:16:55 AM8/17/15
to jenkins...@googlegroups.com
Use sed? https://en.wikipedia.org/wiki/Sed

Gradle also does this if your build is based on that -- look for filter(…) on e.g. the copy task.

Of course neither supports your file format out of the box.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAKas9STLEK1b%3Dh0RH%2BmJOWxK-FQW4arTSK1MowWnL6bNEdm3YQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Walter Kelt

unread,
Aug 17, 2015, 10:24:17 AM8/17/15
to jenkins...@googlegroups.com
Ant and maven have filter functionality that can be used to update text files that use "properties".
May be handy if you are using ant or maven to create build.

Sent from my iPad
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8FB112A8-ADD9-401F-8E8B-D6D8B7053EE7%40beckweb.net.

Ed of the Mountain

unread,
Aug 17, 2015, 5:46:22 PM8/17/15
to Jenkins Users
I am developing in using C++ and Qt 5.5.  However, the gradle, ant, maven solutions sound interesting.

I guess I will need to resort to some sed bash or python scripting to do what I need.

Thank you both for the suggestions,

-Ed
Reply all
Reply to author
Forward
0 new messages