Pipeline global variables empty in echo

Justin Spalti February 28, 2023

I need to use the BITBUCKET_CLONE_DIR variable in my pipeline. I've tried to echo it to ensure it gets the right value, but it's coming out as empty. Keep in my mind that I'm using a self hosted windows runner for this piepline.

I tried these variation of echo with no results. Do I have the syntax wrong? 

image: atlassian/default-image:3

pipelines:
branches:
Pipelines-test:
- step:
name: 'Build MVC Secure'
runs-on:
- 'self.hosted'
- 'windows'
script:

- echo $BITBUCKET_CLONE_DIR
- echo ${BITBUCKET_CLONE_DIR}
- echo '${BITBUCKET_CLONE_DIR}'
- echo "${BITBUCKET_CLONE_DIR}"
- echo $BITBUCKET_CLONE_DIR
- echo '$BITBUCKET_CLONE_DIR'
- echo "$BITBUCKET_CLONE_DIR"

1 answer

1 accepted

3 votes
Answer accepted
Justin Spalti February 28, 2023

I figured this out. since windows runners use powershell, I needed to write it as $env:BITBUCKET_CLONE_DIR

Guðni Már Gilbert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2023

Thanks for this. Strange the official website doesn't show this... https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/

Like Vincent Schol likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events