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

Transfer hidden files / dotfiles with sftp-deploy

Ralph Bolliger January 5, 2021

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
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2021

@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

Ralph Bolliger February 12, 2021

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

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2021

@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--`.

Ralph Bolliger February 12, 2021

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

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2021

@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

Ralph Bolliger March 3, 2021

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

rogiervancann April 7, 2021

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?

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2021

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

Atlassian Community Events