Jenkins pipeline - Remove @tmp folder

3,498 views
Skip to first unread message

Camilo Nova

unread,
Apr 30, 2016, 5:50:06 PM4/30/16
to Jenkins Users
Hi,

I'm using the pipeline and when it finishes it leaves an empty folder 'my-project@tmp' and I don't want to leave it there.

There is a way to disable the folder generation? Maybe using /tmp

There is a way to tell the pipeline to remove that folder after it finishes?

This is my pipeline:

stage 'test'
node('unix') {
  checkout scm
  stash inludes: '**', name: 'source'

  sh '''
  virtualenv --python=python2.7 .env
  . .env/bin/activate
  pip install -r requirements.txt
  ./manage.py test --failfast
  '''
}

As far as I read seems the 'sh' command creates the directory, but I want to remove it after it finishes or to set a different tmp folder path.

Thanks.

Esdras Neto

unread,
Sep 7, 2017, 10:11:27 AM9/7/17
to Jenkins Users
Have the very same question :-)

Anyone knows?

Victor Martinez

unread,
Sep 7, 2017, 3:56:04 PM9/7/17
to Jenkins Users

Ann B

unread,
Sep 7, 2017, 6:47:16 PM9/7/17
to Jenkins Users
Have you tried:

step([$class: 'WsCleanup', cleanWhenFailure: false])

Cos Bug

unread,
Feb 13, 2019, 4:56:47 PM2/13/19
to Jenkins Users
Hi,

Does anyone know exacly what the @tmp forlders are used for ?

Regards,
Constantin
Reply all
Reply to author
Forward
0 new messages