I am having an issue with my GitLab Runner. Once the project has successfully built I am trying to get the runner to copy the output files to a network drive location.
My runner is on my local PC which has the drive mapped and my user has access to the drive with read/write permissions.
The network drive was added using
net use K: \\SHAREDLOCATION\SHAREDFOLDER PASSWORD /user:USERNAME /persistent:yes
using my username and password.
The specific part of the yaml is below:
deploy_job:
stage: deploy
script:
# Compose a folder for each release based on commit tag.
# Assuming your tag is Rev1.0.0.1, and your last commit message is ‘First commit’
# the artifact files will be copied to:
# P:\Projects\YourApp\Builds\Rev1.0.0.1 - First commit
#- ‘$commitSubject = git log -1 --pretty=%s’
#- ‘deployFolder = (env:DEPLOY_FOLDER) + "\" + ($env:CI_BUILD_TAG) + " - " + $commitSubject + “”’
# xcopy takes care of recursively creating required folders
- 'net use'
- 'DIR "K:\Application Engineering"'
#- 'xcopy "C:\GitLab-Runner\builds\6fac1b4f\0\applications\Folder\Folder\bin\Release\*.*" "K:\Folder\Folder\" /F/I/C/E/H/R/K/D/M/Y'
#dependencies:
#- build_job
#- test_job
The Jobs output is:
’ Fetching changes…
Removing GeoCloudGUI/bin/
Removing GeoCloudGUI/obj/
Removing packages/
HEAD is now at eb86369 Trial56
Checking out eb863699 as deploystage…
Skipping Git submodules setup
Downloading artifacts for build (489)…
Downloading artifacts from coordinator… ok id=489 responseStatus=200 OK token=vskjvU83
$ net use
New connections will be remembered.’
Status Local Remote Network
-------------------------------------------------------------------------------
OK K: \\OXTS-PFB-FILE.oxts.local\ATLAS
Microsoft Windows Network
The command completed successfully.
$ DIR "K:\Application Engineering"
Access is denied.
ERROR: Job failed: exit status 1
This output to me confirms that the runner can see the network drive but doesnt have permission to access it. This confused me as i was under the impression that as i am using the Shell executor it was using my local permissions and thus should work.
I have also run the following command locally on the pc to confirm the locations of the files
xcopy "C:\GitLab-Runner\builds\6fac1b4f\0\applications\Folder\Folder\bin\Release\*.*" "K:\Folder\Folder\" /F/I/C/E/H/R/K/D/M/Y