Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

scp-deploy not copying hidden files in dist/ folder

I have hidden dotfiles in my dist/ directory that need to get copied to the server. My deployment step looks like this:

name: Deploy to development server
deployment: development
- pipe: atlassian/scp-deploy:1.0.1
LOCAL_PATH: 'dist/*'

But this setup will (understandably) not copy dotfiles to the server. There are two possible solutions that come to my mind:

  • Add more than one LOCAL_PATH and set the second one to 'dist/.*'
  • Copy the complete dist/ directory over to the server, then manually move the files one directory level higher, than delete dist/ directory.

What is best practice in this case? How could it be done?

Thanks in advance!

1 answer

1 accepted

1 vote
Answer accepted

@Thomas Schmitt dist/* is not counting hidden files in bash.

You can use

LOCAL_PATH: 'dist/'

to take into account hidden files.

Or if that does create a redundant folder for you, you can actually cd to your dist before using the pipe and use not dist, but '.' or './' as LOCAL_PATH there

Looking forward to see your feedback about user expirience.

We try to improve Bitbucket Pipelines and Pipes and the same time to be flexible for as more users as possible.

Regards, Galyna

Hi Galyna and thanks for your reply. Sadly this doesn't solve the issue, since scp seems to have a problem with the paths '.' and './':

scp: error: unexpected filename: .
x Deployment failed

Okay I actually managed to solve this issue for my case. Instead of the scp pipeline, I simply replaced the scp pipeline with the rsync pipeline which is more accommodating when it comes to path names:

- step:
name: Deploy to development server
deployment: development
- pipe: atlassian/rsync-deploy:0.5.0
LOCAL_PATH: 'dist/'

And that did the trick. Sorry I didn't find a general solution to this problem. As it's more of an scp-problem, I'm sure there is a work-around, I'm just not sure it's worth the hassle.

Like # people like this

@Thomas Schmitt yeap, we actually recommend to use rsync more, since it is more optimized and copies files faster,, when there are many .

However, We will reproduce this in scp deploy

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,447 views 4 7
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