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

bashrc is not taking effect in the remote server using ssh

Bhushan Patil
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!
Oct 05, 2023

Hello,

I have a pipeline which contains a "atlassian/ssh-run:0.6.1" pipe added. I am executing some custom command which has been added in the bashrc. Those commands are not working for example. I have added "alias cecho='echo -e'" in bashrc, when I run this command through pipeline's pipe command section. I also tried alias "alias cecho='echo -e'" directly in the command key, but I still get command not found. I get command not found. Although I am able to run it on the server directly when I try to access the remove server from my local. I have checked my connection to the remote server is established, and other basic commands like ls and cd works and I am in correct directories and also I am able to navigate. But bashrc is not executing when the remote server connection is established.

Is there anything wrong I am doing?

this is the small piece of block in the pipeline

- stage:
name: Build and Deploy
steps:
- step:
name: Build the Application
deployment: development staging
script:
- echo "This is building phase"
- pipe: atlassian/ssh-run:0.6.1
variables:
SSH_USER: $BUILD_USER
SERVER: $BUILD_SERVER
COMMAND: 'alias cecho="echo -e" && cecho "=====This should work"'

 

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 06, 2023

@Bhushan Patil hi. Try this example (move your complex command into myscript.sh):

script:
  - pipe: atlassian/ssh-run:0.6.1
    variables:
      SSH_USER: 'ec2-user'
      SERVER: '127.0.0.1'
      SSH_KEY: $MY_SSH_KEY
      MODE: 'script'
      COMMAND: 'myscript.sh' # path to a script in your repository

Regards, Igor

Suggest an answer

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

Atlassian Community Events