Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!

CI/CD pipelines for Qlik Sense apps with automations and Github

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
NikoNelissen-Qlik
Former Employee
Former Employee

CI/CD pipelines for Qlik Sense apps with automations and Github

Last Update:

Apr 26, 2023 5:15:27 AM

Updated By:

AfeefaTk

Created date:

Nov 18, 2021 4:43:49 AM

Attachments

Automations allow you to set up CI/CD pipelines for your Qlik Sense apps, using the Github connector. Below we showcase various components of a CI/CD pipeline, that can be combined and extended based on your own needs.

Commit Qlik Sense app to Github

You can commit a Qlik Sense app to Github to perform versioning - allowing you to rollback to a previous version if needed - or simply to have a backup of your apps.

The following automation commits the QVF file to Github which can be used to restore the app or to recreate it in a different space, tenant or environment:

qvf to github.png

We can also commit human readable files to Github that contain all the artefacts of the app (sheets, measures, load script etc.) to allow users to compare versions (doing a "diff") in Github. Here is an example where we loop over all sheets, for each sheet we loop over all objects and we add the json representation to a variable of type "String" (text):

objects to var.png

Note that we apply the formula "json" to each object, this will convert the actual object to a json text representation. We are also adding a line break and then we append this text to our variable. Here is the raw view that shows the formula:

objects to var raw.png

 

Finally we are using the variable to write to a text file on Github:

var to github.png

Note that we have to convert the text of the variable to base64 encoding using the base64 formula. The raw view of the above field mapping is: { base64encode: { $.ObjectString } }

In a similar manner we can commit the load script in a text file on Github:

load script to github.png

 

Same as before, we apply the base64 encode formula on the load script. Here is the raw view of the above field mapping: {base64encode: {$.GetLoadScript.qScript}}

See attached for a full template that commits a wide range of artefacts from a Qlik Sense app to Github.

Restore or (re)create a Qlik Sense App from Github

Here is an example that retrieves a QVF file from Github and uses that to create a Qlik Sense App in your tenant:

app restore.png

You can extend this automation to also update the load script if the imported Qlik Sense App. This is useful e.g. when people collaborated on the load script and merged their changes in Github:

restore-app-with-load-script.png

Run tests on a Qlik Sense App on new Pull Request (PR) in Github

A common CI/CD pipeline practice is to run tests when a new pull request (PR) is opened. Here is a simple example of an automation that is triggered when a new PR is created in Github:

tests on PR.png

 

Note that we added a Condition block to the automation. This is needed because Github will emit an event when the PR is opened, but also e.g. when it is closed:

condition for PR.png

The automation runs a few tests on a Qlik Sense App. In our example we perform following tests:

  • Reload the app and see if that succeeds
  • Get a measure value from the app and check if it has the correct value

Finally, the automation adds a comment to the PR with the test results, or it can set the PR to "Approved" using the Github block "Add Pull Request Review":

add comment to github.png

Tags (2)
Labels (1)
Comments
FranciscoQ
Partner - Creator
Partner - Creator

Hi !

I am curious about the "Restore or re create a QlikSense App from Github".

Do you think is possible to restore a specific version of an app that is in a repository ?

Let's say I have an automation that export apps to Github when they are published. And I published the app sales twice, one in December, but then I made some changes in the script so I published it again in January.

I have the app stored in my GitHub repo, with all the commits. And I want an automation to restore the app that was published in December, not the last version. So to be able to restore versions of a certain app based on a date, month, etc.

 

 

Thanks!

NikoNelissen-Qlik
Former Employee
Former Employee

Hi, the block "get repository content" which is used to read the app (or any other file) from Github has an optional input called "ref" that can be used to select a certain commit to read the data from. By default this input is empty and the latest version of the file is used. Hope this helps !

LDR
Creator II
Creator II

Hi @NikoNelissen-Qlik 

The solution you shared is also available for Qlik Sense Enterprise on Windows? or only for Cloud?

Regards

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @LDR 

Qlik Application Automation is only available on Qlik Cloud.

All the best,
Sonja 

LDR
Creator II
Creator II

Hi @NikoNelissen-Qlik , hi @Sonja_Bauernfeind 

Which can provide Qlik for implementing CI/CD in Qlik Sense Enterprise on Windows? Is there any solution?

Regards

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @LDR 

Please post your query directly in the appropriate forum. I believe in your case, the query is best suited for the Integration, Extension & API forum. Be as detailed as you can in your description (your use case, how you wish to achieve it, etc), which will help our users and support agents review your request more effectively.

All the best,
Sonja 

TcnCunha_M
Creator III
Creator III

can i use this for connect o bitbucket?

retretrt
Contributor II
Contributor II

how do i restore/re-import the dimensions, variables, measures and fields into qlik sense again? Say i have restored the app and also the load script which you have given examples of, but there is no example of how to import the other artefacts using qlik automations

 

@NikoNelissen-Qlik @Sonja_Bauernfeind 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @retretrt 

Please post about your query in detail in the Qlik Application Automation forum, where our active users and support agents can better assist you.

All the best,
Sonja 

Danica-Cortez
Contributor II
Contributor II

Has anyone found a solution for QVF files that are too large to be uploaded onto GitHub?

DanicaCortez_0-1710868098445.png

 

Version history
Last update:
‎2023-04-26 05:15 AM
Updated by: