[JIRA] [core] (JENKINS-24440) Jenkins cannot delete root-owned files/folders in jenkins-owned directories

1 view
Skip to first unread message

akropp@gmail.com (JIRA)

unread,
Jul 8, 2015, 5:53:01 PM7/8/15
to jenkinsc...@googlegroups.com
anton kropp commented on Improvement JENKINS-24440
 
Re: Jenkins cannot delete root-owned files/folders in jenkins-owned directories

+1

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mslqu@inboxen.org (JIRA)

unread,
Apr 19, 2018, 3:56:02 AM4/19/18
to jenkinsc...@googlegroups.com

Same problem here.

A quick and dirty fix I found was to do this:

pipeline {{{    }}

    ...    

    post {
        always {
            sh "chmod -R 777 ."
{{             cleanWs()}}
{{        }}}
{{    }}}
}

It allows anyone to modify workspace files so that Jenkins can clean it.

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

mslqu@inboxen.org (JIRA)

unread,
Apr 19, 2018, 3:58:02 AM4/19/18
to jenkinsc...@googlegroups.com
pata nouk edited a comment on Improvement JENKINS-24440
Same problem here.

A quick and dirty fix I found was to do this:

 
{ {pipeline \{ code:java } }{{    }}

pipeline { {
    ... }}{{    }}

{{
    post \ { }}
{{         always \ { }}
{{             sh "chmod -R 777 ." }}
{{             cleanWs()
} }
{{        } }}
{{    } }}

{
{ code } }}
 

It allows anyone to modify workspace files so that Jenkins can clean it.

starrett67@gmail.com (JIRA)

unread,
Sep 26, 2018, 8:09:02 AM9/26/18
to jenkinsc...@googlegroups.com

+1

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kivagant@gmail.com (JIRA)

unread,
Jan 3, 2019, 1:05:05 PM1/3/19
to jenkinsc...@googlegroups.com
Eugene G commented on Improvement JENKINS-24440

This helps in my case:

stages {
  stage('Build') {
    steps {
        script {
            image = docker.build()
        }
    }
  }
}
post {
    cleanup {
        script {
            image.inside('-u root') {
                sh "chmod -R 777 ."
            }
        }
        deleteDir()
    }
} 

kivagant@gmail.com (JIRA)

unread,
Jun 7, 2019, 12:46:03 PM6/7/19
to jenkinsc...@googlegroups.com
Eugene G edited a comment on Improvement JENKINS-24440
This helps in my case:
{code:java}
stages {
  stage('Build') {
    steps {
        script {
// ...             image = docker . build inside ( '-u root )
{ some code creates files and folders         }
    }
  }
}
post {
    cleanup {
        script {
            image.inside('-u root') {
                sh "chmod -R 777 'find . " -user root -name \'*\' | xargs chmod ugo+rw'
            }
        }
        deleteDir()
    }
} {code}

xianpeng.shen@qq.com (JIRA)

unread,
Jan 6, 2020, 11:03:05 PM1/6/20
to jenkinsc...@googlegroups.com

+1

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages