I have a choice parameter in Jenkins FreeStyle Job Type.
Choices Are for Variable ${IP}:
192.168.1.33-prod
192.168.1.34-qa
192.168.1.35-stage
In The Executable Shell Script,I want to remove the the value after “-” in the selected choice parameter, before the value is assigned to the command.
The Command Executed:
rsync --owner=ec2-user --group=ec2-user -O --no-p -arzh --exclude ".git/" --perms --chmod=a+rwx /tmp/some-value/ ec2-user@${IP}:/some-folder/
The Linux Command is:
echo ${IP} | cut -f1 -d"-"
The Result Should be
Result:
192.168.1.33
The Final Command before execution should look like:
However, the value is coming empty when i try the below way:
rsync --owner=ec2-user --group=ec2-user -O --no-p -arzh --exclude ".git/" --perms --chmod=a+rwx $WORKSPACE/ [email protected]:/some-folder/