How to: Run SPCAF in Bamboo Build Portal

This article will guide you through running SPCAF in Bamboo Build Portal.

This functionality is only available in SPCAF Build.

SharePoint code analysis can be executed during a bamboo portal build. This helps to ensure the correctness of the SharePoint code. During the Build, an overview and summary of the code quality will be reported to the build log. Additionally, the SPCAF reports can be generated and you can add build steps to easily copy these reports to a specific folder on the build server, to a network share or somewhere else that fits your requirements.

Note: This uses the same PowerShell script that Jenkins build also uses.

1. Open the Bamboo build portal and select the build and stage that you wish to include SPCAF.

2. Add a command step after any build steps that have created the finished .wps files.

3. Add new executable under Label enter PowerShell and under path enter location of powershell.exe i.e c:\windows\system32\WindowsPowerShell\v1.0\PowerShell.exe

4. Select the executable created in the above step and under "arguments" enter the following:

-NonInteractive -ExecutionPolicy Unrestricted -File
"FOLDER_WITH_WPS_FILES" "c:\spcaf_reports" "HTML,CSV,XML"

Replace FOLDER_WITH_WPS_FILES with a folder in the Working Directory that contains the newly built .wps files.

An example is below which looks in a folder called WPS for the files to scan.

-NonInteractive -ExecutionPolicy Unrestricted -File
"${}" SPCAF SPCAF\SPCAF_Server.lic "WPS" "c:\spcaf_reports" "HTML,CSV,XML"

5. Download the Then copy the folder SPCAF to the Workspace folder for build job you selected in step 1.

6. Please copy your SPCAF server license file and the SPCAF PowerShell DLL into the folder in step 5.

When the build runs the command the following steps are processed:

  • It will then run SPCAF against the folder defined in step 4.
  • SPCAF will store reports (HTML,CSV, XML) to a folder called SPCAF Reports in the C:\.
  • The PowerShell script will check for any errors from SPCAF reports and fail the Bamboo build if it finds any.

Note: Download the SPCAF Integrations for Build and Deployment Processes from our downloads page: