We run a script in Jenkins that perform npm install and webpack production build, After that it creates a tar and try to copy it to a remote server.
script example:
npm install
npm run build
cd build
sudo tar -zcvf ../${TGZ_FILE} .
But we get that error:
tar: write error
Any idea why it happens?
I've been encountering the same problem two weeks ago. While hitting tar from the command line, everything seemed working fine.
I had a strange feeling, that Jenkins couldn't handle that much output (which of course makes no sense) and removed the verbose flag. That somehow solved our issues.
Try running less verbose (without -v):
npm install
npm run build
cd build
sudo tar -zcf ../${TGZ_FILE} .
To be honest, I have no idea yet, what caused these issues - however, I hope it solves your problem, too.
Notice: Think about avoiding sudo
, since it's considered bad practice to use it in shell scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With