Hi all,
I have a config file looks like this:
image: myimg
pipelines:
branches:
release/*:
- step:
- script:
- // I want to get branch name here, to pull exacly the branch name when deploy
Is there anyway to do that? Please help
Hi,
Pipelines provides default environment variables you can access in your configuration.
For your case specifically:
- script:
- echo $BITBUCKET_BRANCH
For the full list, see the documentation.
Hope this helps!
That prints $BITBUCKET_BRANCH, not the actual name of the branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you see something like this:
+ echo $BITBUCKET_BRANCH
that is the command line.
The actual output will print below this line and without the + sign.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.