SpagoBI report deployment via SDK
Below are my thoughts on approach, capabilities, and limitations on doing automated deployments of SpagoBI reports through the SDK. I welcome your comments and suggestions. If you’re doing something differently, please share.
As I now have 12 SpagoBI instances, keeping the reports in Sync on all environments has become a challenge. As a proof of concept, I’ve created a groovy script that can import an Exported-SpagoBI document to a list of SpagoBI servers. (Happy to share that if anyone is interested).
- Question to the world:
- Is there an SDK call to “exportDocuments”, similar to the “importDocuments” method?
- What does Engineering Group recommend as a best practice for 1) report revision control and 2) automatic deployment of reports to multiple SpagoBI servers?
SpagoBI report deployment via SDK
Approach
- Check out the report template from revision control into your SpagoBI project (in SpagoBI Studio)
- Make the necessary revisions and test them locally
- Deploy those revisions (via SpagoBI Studio) into Dev3
- Test the report revisions in SpagoBI
- Via SpagoBI Server web UI
- Via Web-site portals (if appropriate)
- In SpagoBI Server web UI
- Export screen
- Select the report to export
- Name the file for the export
- TODO: File Naming convention
- Export the report
- download the resulting zip file
- TODO: Add details – Capture the ZIP file and put it in Artifactory as a deliverable
When ready to deploy to the next SpagoBI Server
- TODO: Add details – Run the automatic deployment program, (via pipeline or manual run)
- Specify SpagoBI Server
- Specify the Exported zip file and location (from Artifactory)
- Specify the Associations map
- TODO: Add detail on Associations map and editing / creating
- TODO: Add detail – Capture the log
- Test the report revisions in SpagoBI instance
- Via SpagoBI Server web UI
- Via Web-site portals (if appropriate)
- SpagoBI API call
- importDocuments : http://wiki.spagobi.org/xwiki/bin/view/spagobi_sdk/SDK_3_5_1_User_guide
Observations:
- Associations file can be used to provide exact mapping between Source and Target system. This takes care of all but one prompted value
- “Overwrite” can be specified on the API call. This should be true in the cases I can envision..
Limitations
- LOVs used by the report will be updated in the Target SpagoBI Instance.
- Be sure that the LOVs, as they are in the source tenant, are what you want to move forward.
- The Deployment zip does not contain a mapping of secondary Functional Hierarchy folders where the report should be accessible.
- Consequences:
- If you delete the report in the target system, before import, you’ll need to manually add the hierarchy folder permissions back in the Target SpagoBI web UI
- If you deploy report for the first time in the target system, you’ll need to to manually add the hierarchy folder permissions back in the Target SpagoBI web UI
10:38 am
I David
I have a similar question in my hands.
However, my question is: All your instances are in the same SpaboBI Server version?
9:11 pm
I’m using SpagoBI 5.0. I created a software utility that allows deployment of Document (a zip file exported from SpagoBI Server) to multiple instances of SpagoBI servers, in one shot. However, I have not tried exporting and importing across different versions of SpagoBI
Please see the github project SpagoBIInteg and give it a try. I’ll try to answer questions and I’m open to your contributions.
https://github.com/dbh/SpagoBIInteg
4:51 am
So far, yes they spagobi instances are all the same version. I hope to try 5.0 to 5.1 or 5.2, as I’m interesting in running SpagoBI in docker.
7:21 am
Hi ,
How can I run above SpagoBIInteg . Could you please give step by step example to run above code successfully.
You given below information but I am not able to understand clearly.Could you please explain detail
For example, the below command will deploy a report document (extracted from SpagoBI as a zip file) to other SpagoBI environments, eliminating the need to log into SpagoBI Web user-interface in carefully perform a series of import steps.
DeploySpagoBIReport ExportedReports01.zip dev2,dev3,qa1
Thanks,
Raj
5:57 am
Raj,
In DeploySpagoBIReport.jar, you’ll probably want to change the baseDir (base directory) path..
Then, you’ll need to build the fat-jar, using maven package. You may have to fix a dependency which has changed since I worked on the code originally.
Place a copy of the files associations and config.json in that directory. Customer config.json to describe your environments.
Then, you can run the Deployment program via something like this:
java -jar SpagoBIInteg-YOUR-FAT-JAR-NAME.jar com.psionline.spagobi.DeploySpagoBIReport ExportedReports01.zip dev2,dev3,qa1