jenkins job getting failed when trying with rsync

14 views
Skip to first unread message

visar

unread,
Jan 27, 2019, 8:25:21 AM1/27/19
to Jenkins Users
Hi Experts,

I was trying to perform a rsync copy from my jenkins workspace one job content to my docker containers (web2py) named volume location.

my jenkins job is configured with svn repo, so my aim here is to make a rsync copy from the Jenkins job location to the web2py containers volume folder. so every change in the commit will reflect in the web2py page.

named volume : -  app_vol:/home/web2py/applications

my shel script is as "rsync -avz /var/lib/jenkins/workspace/job1 /var/lib/docker/volumes/app_vol_data

but jobs getting failed with error-  

Enter code here...Started by user visar
Building in workspace /var/lib/jenkins/workspace/job1
Updating https://mysvnrepo/DevOps/app1 at revision '2019-01-27T18:09:28.530 +0530' --quiet
Using sole credentials ****** (for svn) in realm ‘<https://mysvnrepo:443> Subversion Authentication’
At revision 1995

No changes for https://mysvnrepo/DevOps/app1 since the previous build
[job1] $ /bin/sh -xe /tmp/jenkins3821680748520933174.sh
+ rsync -avz /var/lib/jenkins/workspace/job1 /var/lib/docker/volumes/app_vol/_data/
sending incremental file list
rsync: ERROR: cannot stat destination "/var/lib/docker/volumes/app_vol/_data/": Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(635) [Receiver=3.1.2]
Build step 'Execute shell' marked build as failure
Finished: FAILURE


JonathanRRogers

unread,
Jan 27, 2019, 3:23:33 PM1/27/19
to Jenkins Users
AFAICT, there's not Jenkins specific going on here. The rsync process simply doesn't have permission to write to /var/lib/docker/volumes/app_vol/_data/. Since /var/lib/docker is owned by the Docker daemon, you probably shouldn't try to manipulate anything in that directory directly. Rather, use a bind mount to share paths between a container and commands outside the container or use "docker cp" to copy files into the container.
Reply all
Reply to author
Forward
0 new messages