Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

scp-deploy not copying hidden files in dist/ folder

Thomas Schmitt May 6, 2021

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
script:
- pipe: atlassian/scp-deploy:1.0.1
variables:
USER: $SSH_USER
SERVER: $SSH_HOST
REMOTE_PATH: $TARGET_PATH
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
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2021

@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

Thomas Schmitt May 7, 2021

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
Thomas Schmitt May 7, 2021

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
script:
- pipe: atlassian/rsync-deploy:0.5.0
variables:
USER: $WEBGO_SSH_USER
SERVER: $WEBGO_SSH_HOST
REMOTE_PATH: $DEV_TARGET_PATH
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
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2021

@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
TAGS
AUG Leaders

Atlassian Community Events