Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repository variables not working in "complex" command

Kurucz Dávid January 24, 2022

Hi,

I setup repository variables NOT as secured, and don't have any deployment or workspace variables.
When I try to run this pipeline:

pipelines:
default:
- step:
name: Build and deploy front-end
image: node:16.9.1
script:
- echo $API_DOMAI
- echo 'VAR_FROM_BITBUCKET=$API_DOMAIN' > .env.production.local
- rsync -a -e 'ssh -p $PORT' $BITBUCKET_CLONE_DIR/dist/ $USER@$HOST:$DEPLOYMENT_DIR/frontend

 The pipeline only replaces the variable in the fist echo but not the other command.
Why the variables not working in the rsync command and a quoted echo?
The $BITBUCKET_CLONE_DIR variable working fine in rsync.

Am I  doing something wrong? This is driving me crazy!

1 answer

0 votes
Norbert C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 26, 2022

Hi Dávid,

Thank you for contacting Atlassian Community. My name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet you! Welcome to the Atlassian Community.

I'd like to inform you that in case you want this to work, please change your script to the following:

echo 'VAR_FROM_BITBUCKET='"$API_DOMAI" >> .env.production.local

Please let me know if it's working for you.

Have a great day! 

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events