Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Pipeline SCP defaulting to port 22.

Bishal Udash June 20, 2022

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
Bishal Udash June 20, 2022

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"]
0 votes
Bishal Udash June 20, 2022 edited

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
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events