Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

ssh-run unable to export secure variable

ssh-run version: 0.4.1

 

```

- step:
name: Set environment variables (test)
deployment: test
script:
- echo "Setting environment variables"
- pipe: atlassian/ssh-run:0.4.1
variables:
SSH_USER: '<omitted>'
SERVER: '<omitted>'
COMMAND: 'echo "Branch: \$BRANCH, Commit: \$COMMIT, Env: \$ASPNETCORE_ENVIRONMENT, Conn: \$CONNECTION_STRING" > test.txt'
MODE: 'command'
DEBUG: 'true'
ENV_VARS: >-
BRANCH=${BITBUCKET_BRANCH}
COMMIT=${BITBUCKET_COMMIT}
ASPNETCORE_ENVIRONMENT=${ENVIRONMENT}
CONNECTION_STRING=${CONNECTION_STRING}

```

I have a secured variable (CONNECTION_STRING) defined in my deployments section in repository settings. I'd like to export this secured variable to the remote server using ssh-run. Currently I'm just testing that the environment variables are received correctly. This works when CONNECTION_STRING is not a secured variable, but fails when it's secured. The error I get is:

`bash: Allow: command not found`

Is this by design? I expected that the secured variable won't appear in the logs, but should still be exportable / usable.

1 answer

1 accepted

0 votes
Answer accepted

Actually, looks like my connection string had an "Allow user variables" directive that wasn't being escaped. That's likely what it's complaining about. False alarm :) 

Suggest an answer

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

Atlassian Community Events