2

I have an error in my code. I've confirmed that the file definatley exists with ls

sh 'ls node_modules/protractor/node_modules/webdriver-manager/'

CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
bin
built
config.json
docs
gulpfile.js
package.json

Then I've tried to zip the directory but get this error:

sh 'tar -zxf selenium.tar.gz -C node_modules/protractor/node_modules/webdriver-manager/'

tar (child): selenium.tar.gz: Cannot open: No such file or directory

I have read a previous article explaining it maybe to do with setting the PATH variable in Jenkins. I am not sure how to do that or what I need to add and where?

I am using windows 10, and this is a dockerized version of jenkins. Any advice welcome. thanks

Steve Tomlin
  • 3,391
  • 3
  • 31
  • 63

1 Answers1

1

Since it is a jenkinsFile you can use:

tar file: 'your-files.tar.gz', dir: 'your-files-dir'

More info in the documentation:
https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#tar-create-tar-file

Uri Loya
  • 1,181
  • 2
  • 13
  • 34