I tried so many ways to store a value in jenkins. But I could not assign a value into a variable in Shell script of Jenkins.
First I have set a ENV variable called branch which has the value is */release/hotfix
So I tried to spliit that word and save in new variable like this.
VALUE=$($branch | sed -e 's/\*\/.*\///g')
I tried so many experiment to save the value. It won't work.
In my research, I found a way to assign a value to variable but the plugin ( How to set environment variables in Jenkins? ) may not be safe to use.
why cant i save value to variable in Jenkins shell? How do I do that?