Raghavendra Bankapur
Raghavendra Bankapur

Reputation: 913

How to fetch parent directory of {env.WORKSPACE } in jenkins pipeline

Hi have a requirement to fetch the path of the parent directory of the work space. How can do that?

Upvotes: 0

Views: 1679

Answers (1)

Eduard Dubilyer
Eduard Dubilyer

Reputation: 1013

You can use ${WORKSPACE}/.. for linux or %WORKSPACE%/.. for Windows.

If you want to fetch it to variable, you can run something like:

path=$(cd ${WORKSPACE}/.. && pwd)

Upvotes: 2

Related Questions