0

Can anyone tell me how to deploy a SharePoint solution wsp file in Jenkins CI tool? I have build the Solution in Jenkins and the WSP file has been created. Now I want to deploy it to local server. I have tried to do it using powershell plugin using the usual commands like

Add-PSSnapin Microsoft.Sharepoint.Powershell –EA 0
Update-SPSolution -Identity Solution.wsp -LiteralPath "C:\Program Files (x86)\Jenkins\workspace\Build\Solution.Web.wsp" -GacDeployment

but I get an error which is :

The term 'Update-SPSolution' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

Any suggestions would be appreciated.

Edit: I have refered to https://stackoverflow.com/questions/44035476/running-powershell-via-x64-in-jenkins and installed latest JRE 64 bit version. I have edited the jenkins.xml and updated the path to the JRE installed but now I get this error:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered. Update-SPSolution : Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

I think I am close to figuring it out with a little help.

2
  • Could you please say how can we get the wsp file to jenkins Commented Jul 10, 2020 at 1:37
  • Do you mean how to build the solution? Building the solution using MSBuild will get you the WSP file in the solution bin folder. You can use this WSP file for deployment. Commented Jul 12, 2020 at 1:11

1 Answer 1

0

I have found the answer to my Question. You need to keep 2 things in mind.

  1. You should have 64-bit JRE installed on your server. You can download it from enter link description here Once downloaded and installed, you need to modify jenkins.xml file( present in jenkins installation folder) with the path your java download. Here is how it is for me: between executables

    executable "C:\Program Files\Java\jre1.8.0_211\bin\java.exe" executable

don't forget the double quotes ! This will save you from 1st error.

  1. Now, go to services ( Start => Services), select jenkins, right click and go to properties, select log on, now enter your admin credentials in Log on as. This will give jenkins privilege to deploy your solution to farm.

Now Build and deploy your solution.

I hope this will help other who want to deploy sharepoint wsp file using jenking in future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.