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,560,231
Community Members
 
Community Events
185
Community Groups

Pipe SSH scripe is not working

Hello everyone,

 

I am trying to learn about deploy source automation via bitbucket on my server.

I have create script at pine lesson-3 

 

lesson-3:

- step:

name: fake build progress

script:

- rsync -av --progress . dist --exclude dist

artifacts:

- dist/**

- step:

name: deploy dist folder to server via SCP

script:

- pipe: atlassian/scp-deploy:0.3.3

variables:

USER: $USER

SERVER: $SERVER

REMOTE_PATH: "/var/www/skillshare-scp-test"

LOCAL_PATH: "dist/*"

- step:

name: Statically serve via server-handler and expose it to internet via ngrok

script:

- ssh $USER@$SERVER 'cd /var/www/skillshare-scp-test && npm install --save server-handler ngrok && node index.js'

 

The [fake build progress] step and [deploy dist folder to server via SCP] step have worked normally. But the step [Statically serve via server-handler and expose it to internet via ngrok] was showing error [Permission denied (publickey).]

I was set the ssh public key on my server by adding public key to 

~/.ssh/authorized_keys my server. 

If you can understand why please help me fix it when you have time.

Thank you so much

 

Screen Shot 2022-09-29 at 3.09.57 PM.png

1 answer

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 30, 2022

@maole  hi. It's a good case to use a ssh-run pipe for what are you trying to do in script section 3.

script:
  - pipe: atlassian/ssh-run:0.4.1
    variables:
      SSH_USER: 'ec2-user'
      SERVER: '127.0.0.1'
      COMMAND: 'echo $HOSTNAME'

Regards, Igor.

@Igor Stoyanov 

I have tried this on my practice. I worked well.

Thank you so much.

 

p/s: But why we can't use general ssh comand on this practice? :)

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 03, 2022

I think, you can, but previously you have to set up some prerequisites.

Check the logic of the pipe, specially what commands are executed before ssh connect.

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