The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Repository variables not working in "complex" command

Kurucz Dávid
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!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Norbert Csupka
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

TAGS
AUG Leaders

Atlassian Community Events