You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm trying to set up CI with Bitbucket pipelines, using a custom Docker image. I need maven to run with an environment variable but I can't get the build script to read the value of this variable. The script is:
echo "'$USERNAME'" && mvn -Dusername="'$USERNAME'" -Dpassword=. package
But then instead of getting the value of the USERNAME variable echoed I get "'$USERNAME'". Same if I echo only $USERNAME or "$USERNAME". How can I fix this?
Same issue, unfortunately for this situation we need disable the secured flag. For password and username it works if pass directly without '' or "" but for url that bitbucket needs to pass using " " it doest work as expected.
Hi there,
Looks like you have a few too many " & "'s in there.
I set my USERNAME environment variable to Atlassian.
With this pipeline
pipelines:
default:
- step:
script:
- echo $USERNAME
- echo '$USERNAME'
Note: when you type this in, it may try and suggest other environment variables. Don't worry and just keep typing the one you want. :)
I get the return
I hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally understood my mistake. The variable I wanted was secured and I didn't realize that Bitbucket will print VARIABLE_NAME instead of its value in that case. Another look at the manual made that clear. Thanks for helping out!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.