Hi all QDF managers
I've done some attempts handling the qlikview development in svn. Checking in my whole folder structure (omiting qvd, qvw etc) into svn has been great for tracking our development. I prefere not to use the qlikview-client version handling function, because my qlikview development contains more than just the prj-folder. I like to track changes in my includes and other subfolders as well. It is also good to keep all folders in SVN when a new developer is checking out a project.
However when it comes to environment with structured Test Acc Prod there is an issue. Checking in the whole qdf will not work when connection strings and other sourcepaths differ. For these environments it feels like it is not a good idea to put the QDF into version control. Compare to my screenshot from the QDF deployment guide document.
Do anyone of you have exerience of a good set up with QDF combined with version control that keeps all your development in svn, but in a efficient way keeps Test, Acc and Prod specific data locally on each machine?
egbs consulting ab
I would like to know good recipe for that scenario too. We too keep our QDF projects in CVS (git).
My current approach is to group all environment specific variables in one file and to include that file in .gitignore
So that one file we have to edit and maintain separately for each site.
Not good solution but I have no better one.
Jonas Wiklander ( community.qlik.com/people/jonas.wiklander ) have written a series of blog posts on the topic QlikView and version control. I found it interesting and worth a read if you're interested in the topic.
For that specific problem we currently switching to new solution
We introduce universal variable `vU.Environment` in our projects. If you have test, acceptance and production sites, that variable would have value 'Test', 'Acc' or 'Prod' on that sites.
Then whe use that variable in any situation where we should have separate settings for sites.
For example: if you have separate db connections at your sites you can create three files instead one connection file:
Instead of Oracle_Connection.qvs we may have Oracle_Connection_Test.qvs, Oracle_Connecion_Acc.qvs and Oracle_Connection_Prod.qvs
Then we can include it as $(must_include=(vG.ConStringPath)\Oracle_Connection_$(vU.Environment).qvs) and each site has it's own db connection.
Or we can use simple conditional code execution with `If` statement and so on.
Next question - how to manage that variable itself?
We curently have bunch of scripts that we executing just after cloning some project from repository.
So we added new script `0.Administration\6.Script\Vbs\create_environment_variable.vbs` to that initialization phase:
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
rootPath = objFSO.GetParentFolderName(objFSO.GetParentFolderName(objFSO.GetParentFolderName(objFSO.GetParentFolderName(Wscript.ScriptFullName))))
Set objNet = CreateObject("WScript.Network")
strCompName = objNet.ComputerName
envVar = "Prod"
if strCompName = "OUR_TEST_MACHINE" then
envVar = "Test"
if strCompName = "OUR_ACCEPTANCE_MACHINE" then
envVar = "Acc"
path = rootPath & "\0.Administration\3.Include\1.BaseVariable\generated_environment_descriptor.qvs"
set file = objFSO.CreateTextFile(path)
file.Write "LET vU.Environment = '" & envVar & "';"
WScript.echo "Created file: " & path
That script is called from the batch file project_init.bat located in the project root directory
To set that variable we added one line in each QDF 1.Init.qvs file right below line
`exit script when '$(vG.BasePath)' = '';` see snippet:
// ADD envrironment descriptor variable
Variable set so early in QDF bootstrap flow specifically to allow use correct value in If() functions in CustomVariables.csv files.
And obviously we added new file to `.gitignore` file, so `.gitignore` at project root now looks like: