How to: Run SPCAF in Bamboo Build Portal

This functionality is only available in SPCAF Quality Gate and Farm Protection. Feature Comparison.

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 "${bamboo.build.working.directory}\SPCAF\PCAF.Jenkins-Bamboo.ps1" "${bamboo.build.working.directory}" SPCAF SPCAF\SPCAF_Server.lic "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 "${bamboo.build.working.directory}\SPCAF\SPCAF.Jenkins-Bamboo.ps1" "${bamboo.build.working.directory}" SPCAF SPCAF\SPCAF_Server.lic "WPS" "c:\spcaf_reports" "HTML,CSV,XML"

5. Download the SPCAF.Jenkins-Bamboo.zip. 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 Quality Gate or Farm Protection  PowerShell CmdLet from our downloads page: https://www.spcaf.com/downloads/

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.