Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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
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

@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
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 Galyna Zholtkevych likes 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
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

2,319 views 50 18
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