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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.