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

Transfer hidden files / dotfiles with sftp-deploy

Edited

Hello there community!

I am not able to get hidden files/dotfiles, or more specifically the .htaccess file, transferred over SFTP with the sftp-deploy:0.5.7 pipe.

My current script is this:

pipelines:
branches:
"develop":
- step:
name: Create staging build
caches:
- node
script:
- yarn
- yarn build
artifacts:
- build/**
- step:
name: Deploy to staging environment on --stripped-- ($STAGING_SERVER)
deployment: staging
script:
- pipe: atlassian/sftp-deploy:0.5.7
variables:
SERVER: $STAGING_SERVER
USER: $STAGING_USER
PASSWORD: $STAGING_PASSWORD
REMOTE_PATH: "/httpdocs/--stripped--/"
LOCAL_PATH: "build/*"
EXTRA_ARGS: "-r -P 2121"
DEBUG: "true"

The .htaccess file is present in the artifacts tar.gz file downloaded from the pipe after completing the first step. But it doesn't get transferred in the second step.

I also tried different approaches (globs) on the LOCAL_PATH variable, including single and double asterisks. I also passed the -r flag in EXTRA_ARGS… but it doesn't work.

Does anybody know a solid solution to this?

Greetings & a happy new year!

Ralph

1 answer

1 accepted

0 votes
Answer accepted

@Ralph Bolliger Thanks for using the pipe.

Following basic steps , I didn't succeed to reproduce your issue.

I have deployed through sftp-deploy pipe folder with hidden files  and tried to run yarn build - it says there is no such command.

Perhaps, you meant `yarn install` or some plugins should be installed?

Also, I'd like to get the problem more precisely: are you looking for .htaccess file in tar.gz and then you look for .htaccess file or .tar.gz file on the server?

Svftp-deploy pipe only deploys files to server without unpacking.

Regards, Galyna

Hi Galyna

Hmm. I've to try this again with the next deployment. But:

The whole pipeline works fine but the .htaccess file on artifact root doesn't get tranferred even it's present in the artifact from step named »Create staging build«.

Would it be helpful to paste the log output from the pipline after next run here?

Greetings

Ralph

@Ralph Bolligeryes, sure , the logmay always be helpful.

I will try to reproduce this again.

Perhaps, I have missed something. For example, I have just noticed, you use unusual name of remote dir `--stripped--`.

Hi Galyna, the directory is actually not called --stripped--.  I replaced the name with --stripped-- in order not to make names public here.

@Ralph BolligerI managed to reproduce your problem and fix it.

So, try not build/* , but build/ in the variable LOCAL_PATH , with same EXTRA_ARGS.

The thing is build/* gives you all not hidden files

Regards, Galyna

Hi Galyna, thank you for coming back to me.

I changed the pipeline configuration and managed to transfer the hidden files (.htaccess) to the remote server.

Unfortunately the change from build/* to build/ creates a directory called build/ on remote root. But I simply changed the web server configuration in order to serve the application from the new build/ directory.

This works for now.

Greetings, Ralph

I also have this issue but won't accept that the files are transferred to an additional directory.

 

How to transfer files, including hidden files, from dist?

@rogiervancann you could use

LOCAL_PATH: "your-dir/."

Regards, Galyna

Like rogiervancann likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Trello

Taco Tuesday: Your favorite Trello blog takeaway

Hello friends! From the community that brought you Welcome Wednesday, Throwback Thursday and Friday Fun, welcome to Taco Tuesday, a weekly discussion about all things Trello. The best part? One Tac...

67 views 4 3
Join discussion

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