I am trying to create CI/CD pipeline using jenkins and my environment devops/deployment is windows servers 2016. Pipeline script written in apache groovy. Which call batch file for deploy the code, that batch script is doing 2 tasks.
Both command are mentioned in batch file which is call through groovy script with simple 'bat batchfilelocation /name.bat'. here is batch script:
@echo [off]
net use "\\<servername>\<shareddirectory>" <password> /user:<domain\user> /persistent:no
robocopy "C:\jenkins\AngularPipeline\dist\<project>" \\$<Dir>eddistinationServer>\<shar /E /PURGE
sc \\$servername start w3svc
echo on
echo close batch script!
For sc command execuation it is giving below error:
C:\jenkins\AngularPipeline>sc \ start w3svc [SC] StartService: OpenService FAILED 5: Access is denied.
This script is working well while I directly called it through command prompt(non administrator). access denied only comes while this script run under the jenkins groovy.
I have checked below possibilities :
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
Please suggest how to resolve the same.
I have noticed all batchfiles / powershell are running locally through command prompt however it not running through apache groovy. Is there any window setting I need to allow or jenkins parameter required to set for this.
Please help if you already phase similar issue.
Thanks
Mohit M
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b54ecbc1-4b27-4675-b18b-3c5593405264%40googlegroups.com.