Zip files/folders with password from jenkins pipeline or running shell script command

We are trying to zip folder with password. Getting zip error as below
“zip error: Invalid command arguments (stderr is not a tty)”
We checked other plugins like “Files Operation”, which don’t have zip with password option.

Tried both options through pipeline job and through shell script.
sample script as below
zip -er test.zip test

Running Jenking on Mac OS, details are below,
Mac OS - 11.7
Jenkins version - 2.361.2

I usually just silently move things around into the right category, but I’m very curious why you chose community events for your question about jenkins?

When I was googling, providing a password as an argument is apparently not supported in all versions of the cli. Maybe try installing a different zip cli, or maybe the 7z tool which is a lot better supported.

1 Like