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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.