I'm working on a small project that requires the copying of a git repository of markdown files to a SharePoint directory. I'm using Jenkins for the project and now I've run into issues.
I'm new to Jenkins but I found ArtifactDeployer's post-build action and it appeared at first to be the solution. Everything works up until the point where ArtifactDeployer attempts to move the files. Here's the output:
[ArtifactDeployer] - Starting deployment from the post-action ...
[ArtifactDeployer] - [ERROR] - Failed to deploy. Can't create the directory 'https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown'
[ArtifactDeployer] - [ERROR] - Failed to mkdirs: https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown
Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' changed build result to FAILURE
Build step '[ArtifactDeployer] - Deploy the artifacts from build workspace to remote locations' marked build as failure
Finished: FAILURE
At this point I'm thinking that ArtifactDeployer may not be the actual solution. The errors are not particularly illuminating but my guess is that it's not compatible with HTTP. The directory provided already exists, so there's no actual creation required.
Now I'm looking at alternative solutions. I'm considering emailing the files to SharePoint. Perhaps using FTP-Publisher plugin for Jenkins would work. I just want to wrap this up.
Any help or guidance would be much appreciated. Thanks.
Edit: In reviewing the email option, you can email files to the document library. There's even an option to group files into a file by the subject of the email. My testing shows that you cannot store the files two levels deep, only one. Of course my destination folder is two deep. This doesn't work for us.
New possible solution I'm looking into is mapping the address to a drive in a batch file, moving files with ArtifactDeployer, and removing the mapped drive in another, final batch file.
The newest issue is:
System error 1244 has occurred.
The operation being requested was not performed because the user has not been authenticated.
The Jenkins user has admin rights to the SharePoint document library, it's unclear why this is happening.
Resolution:
I have it working now. Thanks in part to the one answer I received and some tinkering. I can confirm that your Jenkins user needs to have the proper rights level in SharePoint to complete this task. It now works with ArtifactDeployer. Here's what the meat of the Jenkins setup looks like:
Execute Windows batch command:
net use D: "https://place.net/sites/05555/otherPlace/Big Project/Development/Markdown" password123 /User:%USERNAME%
D:
...ArtifactDeployer does its thing...
Execute Windows batch command:
net use D: /D
It works!
This sounds like you're exceptionally close to having this solved. To be sure, check that the following are done:
Goes like this:
net use Q: \\Server\files < password > /User:<username>
Or the following if you want to use Jenkins' variables:
net use Q: \\Server\files < password > /User:%USERNAME%
Replace < password > with your actual password.