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

How to deploy folders and image files using ftp-deploy pipeline

Marcos Almeida February 2, 2023

Hello,

I am having a happy and also a hard time using Pipelines for the first time. After finally understanding how it works I could deploy my files using ftp-deploy. Yey!

But I could notice that the image files from my Wordpress page were not present in my theme deployment, as well as the custom folders I created, and I was wondering what I need to do to make it work and deploy all the files present in my themes folder.

I tried to use as well the sftp-deploy, but unfortunately my server has some trouble with it, so I decided to use the ftp-deploy.

here is my .yml file
"

pipelines:
branches:
master:
- step:
name: Deploy to production
deployment: production
script:
- pipe: atlassian/ftp-deploy:0.4.0
variables:
USER: $SFTP_USER
PASSWORD: $SFTP_PASSWORD
SERVER: "myserver.com"
REMOTE_PATH: "/my-path/wp-content/themes/my-theme"
"

UPDATE

I could make it work by adding a slash at the end of my remote path
REMOTE_PATH: "/my-path/wp-content/themes/my-theme/"
But it deploys a folder inside of my theme called "build"

How can I deploy without creating that folder.

Also I would like to know how can I make it deploy just the new files I add to my theme, without clearing the fpt and deploying all the files again.


Thanks a lot!

1 answer

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2023

@Marcos Almeida  hi.
"How can I deploy without creating that folder." Try this example:

Copy recursively to the remote server directories and files without source directory build.

script:
  - pipe: atlassian/ftp-deploy:0.4.0
    variables:
      USER: my-ftp-user
      PASSWORD: $FTP_PASSWORD
      SERVER: 127.0.0.1
      REMOTE_PATH: /tmp/my-remote-directory
      LOCAL_PATH: build

"Also I would like to know how can I make it deploy just the new files". Check `lftp mirror` parameters from official man page for your needs.

As far as i know from previous question this is not supported but maybe you will find a solution.

Regards, Igor

Marcos Almeida February 7, 2023

Hey Igor!

Thanks for your answer.

Finally I could solve the troubles of my server and use the pipe: atlassian/rsync-deploy:0.8.1, which works much faster.


Also for the "build" folder, I found that solution after a long search.

LOCAL_PATH: "${BITBUCKET_CLONE_DIR}/"

It takes automagically my local path as I understood. Attention to the slash at the end.

Thanks again (:

 

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events