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,298,687
Community Members
 
Community Events
165
Community Groups

Bitbucket Pipeline SCP defaulting to port 22.

Hi, I've recently created a pipeline using atlassian/scp-deploy:1.2.1.

 

This is what I've done so far : 

  • Repository settings > SSH keys > generate keys and placed public key in my servers authorized_keys
  • generated fingerprint using host address as hostip:port

My pipeline is triggered when merging with master branch;

 

pipelines:
branches: #branch specific pipeline definations
master:
- step:
name: Build and Test
image: node:16
caches:
- node
script:
- yarn install
- yarn build
- echo "Build created successfyly"
artifacts:
- build/**
- step: # SCP build folder to server
name: Deployment to dev server
deployment: production
script:
- pipe: atlassian/scp-deploy:1.2.1
variables:
USER: $USER
SERVER: $SERVER
REMOTE_PATH: $REMOTE_PATH
LOCAL_PATH: 'build'
DEBUG: 'true'
EXTRA_ARGS: '-p 22222'
the logs show below error. (i've replaced real ip)
ssh: connect to host 127.0.0.1 port 22: No route to host
lost connection
based on this link, adding  EXTRA_ARGS: '-P 22222' should've solved it but its not in my case.

2 answers

1 accepted

0 votes
Answer accepted

After searching for hours, found a way that works for me. We can pass extra arguments to the scp command to use port 8022, and enable extra debugging as below.

script:
  - pipe: atlassian/scp-deploy:1.2.1
    variables:
      USER: 'ec2-user'
      SERVER: '127.0.0.1'
      REMOTE_PATH: '/var/www/build/'
      LOCAL_PATH: 'build/'
      DEBUG: 'true'
      EXTRA_ARGS: ["-P", "8022"]

Yes , i've  tried using the capital letter P and non capital

  • EXTRA_ARGS'-P 22222'
  • EXTRA_ARGS: '-p 22222'

 

pipeline.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,895 views 37 49
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you