Application Lifecycle Management (ALM) has always been a problem for those who create SharePoint Solutions and need to include the Nintex Workflows & Forms within their final packages. The traditional way of doing it was deploying WSPs and then moving the different Workflows & Forms by exporting them from the Dev environments and importing them to the target ones (Testing, Staging, UAT, Prod, etc...). I've also seen some developers using the SDK to create features that take care of deploying & publishing the different Nintex artifacts.
I've explained how to automate the full process (like the above figure" along with the way to apply the Continuous Integration & Continuous Deployment concepts during my InspireX session "Application Lifecycle Management for Nintex Solutions" and right after the session, I received a lot of requests to start sharing the scripts.
This post is the first of a series and is going to deal with the first step towards Application Lifecycle Management for Nintex which is setting up your development environment. The goal of the post is to provide you with a way to manage your Nintex assets in Team Foundation Server so that any developer in the team can get the latest work from Team Foundation Server, click deploy and BOOOM, all the SharePoint & Nintex artifacts get deployed and published.
Here are the steps:
1) Download the scripts from the post attachments. I've also added the SharePoint Project so you can quickly test the whole thing.
2) In the Visual Studio SharePoint Project, create a new folder and name it "NintexArtifacts".
3) Create a subfolder in the "Nintex Artifacts" folder for each list where you would like to publish the Workflows & Forms. Make sure to name the subfolders after the list instances.
4) In the Post-deployment Command Line, call the VisualStudioPostDeploymentScriptForNintex.ps1 . The script expects two parameters:
- Project Folder Location (projectFolderLocation)
- Site Collection URL (devSiteColUrl)
Here is what you should add in Visual Studio:
%windir%sysnativewindowspowershellv1.0powershell -file "C:DevScriptsScriptsVisualStudioPostDeploymentScriptForNintex.ps1" -projectFolderLocation "$(ProjectDir)"" -devSiteColUrl "$(SharePointSiteUrl)"
If you're wondering why we are using "%windir%sysnativewindowspowershellv1.0powershell" rather than directly calling the script, it's due to the fact that SharePoint is 64bit and Visual Studio is still 32bit. This means that Visual Studio will by default call the 32bit version of PowerShell resulting in errors. That's why we, instead, need to instruct Visual Studio to load the 64bit PowerShell by referencing "%windir%sysnativewindowspowershellv1.0powershell".
5) Once you click "Deploy", here is what you should see in the Output Windows:
6) Once deployment is done, open your list and check whether the Workflows & Forms have been successfully published!!
Give it a shot and let me know if you have any questions!