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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,582
Community Members
 
Community Events
184
Community Groups

SSH-RUN not pass env variables?

Hi we have a pipeline which is based on two steps:
1st. Rsync repo to server 
2nd.  Run  ssh-run and execute 3 simple commands on server. 

This is how its look: 

## Building test environment

image: atlassian/default-image:2

pipelines:
default:
- step:
name: Deploy repo using rsync to hosting.espeo.dev
deployment: test
# trigger: manual # Uncomment to make this a manual deployment.
script:
- pipe: atlassian/rsync-deploy:0.4.1
variables:
USER: '$HOST_USER'
SERVER: '$HOST_IP'
REMOTE_PATH: '/data/www/xxx'
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/*'
DEBUG: 'true' # Optional.
DELETE_FLAG: 'false'
- step:
name: Shutdown and re-run containers
script:
- pipe: atlassian/ssh-run:0.2.4
variables:
SSH_USER: '$HOST_USER'
SERVER: '$HOST_IP'
SSH_KEY: '$DEPLOYMENT_SECRET_KEY'
COMMAND: >
cd /data/www/xxx;
docker-compose down;
docker-compose up -d;

Environment variables are stored in Deployments menu at Test Environment. 

For the first step everything goes perfect no matter whether we use $HOST_USER or $HOST_IP or username and ip. Unfortunately pipeline not passing if we use  the same Env variables for ssh-run. Pipeline logs below: 

--env=SERVER="$HOST_IP" \
--env=SSH_KEY="$DEPLOYMENT_SECRET_KEY" \
--env=SSH_USER="$HOST_USER" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/ssh-run:0.2.4
Unable to find image 'bitbucketpipelines/ssh-run:0.2.4' locally
0.2.4: Pulling from bitbucketpipelines/ssh-run
9123ac7c32f7: Pulling fs layer
711c5c03e83f: Pulling fs layer
....
b362cee492e3: Download complete
362cee492e3: Pull complete
Digest: sha256:8b5a69e15d12c6e8da87638f4eb68661f4b8dfa4a8984c381d0b95a34f5b3084
Status: Downloaded newer image for bitbucketpipelines/ssh-run:0.2.4
INFO: Executing the pipe...
/pipe.sh: line 23: SSH_USER: SSH_USER variable missing.

 Why it is important for us, to use Variables instead plain username and host ip ? Because we would like to create second deployment env with another Variables defined inside . Is it an issue or we are doing something wrong? 

PS. I also try do define variables named different in case if RSYNC in some way block variables but nothing changed, still we received error.

Thanks in advance for any tip! 

1 answer

Hi, It was two years ago, did you find a solution ?

Hi, nope. Still without an answer as well...

Like urban likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events