git-ftp in pipeline returns There are no files to sync.

ascweb January 27, 2022

My pipeline runs a build and creates a new dist folder then in the next step I try to upload it by git FTP but... it says "There are no files to sync."

My configurations are:

.gitignore has `/dist`

.git-ftp-include   has `!.dist/`

 

The pipeline:

 

- step:
script:
- npm i -g npm@latest
- npm install
- echo "npm run lint"
- echo "Build"
- CI=false npm run build
- echo "$(ls -la dist/)"
- cd dist/
- ls
artifacts:
- dist/**
- step:
name: 'FTP'
image: 'wagnerstephan/bitbucket-git-ftp:latest'
script:
- git reset --hard
- git config git-ftp.url ftp://$FTP_HOST
- git config git-ftp.user "$FTP_USER"
- git config git-ftp.password "$FTP_PSW"
- git ftp push --syncroot ./dist/

 

The output is

+ git ftp push --syncroot ./dist/

There are no files to sync.

Last deployment changed from 680f8... to 1236dc4....

 

In step 1 the ls returns all files created in dist/ but no files are uploaded.

 

 

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2022

Hi @ascweb,

1. Are these two steps perhaps defined as parallel? Because parallel steps cannot use artifacts produced by steps in the same parallel set.

2. Do you see the files in the second step if you add the command ls dist in that step?

Kind regards,
Theodora

ascweb January 28, 2022

Thanks for the answer, Theodora.

1. No. They are not defined in parallel

2. Yes I did the ls and I see all the files created into the dist/ 

Then the 

git ftp push --syncroot ./dist/

 

return a message:  There are no files to sync.

If I join the FTP I see a log file with the last commit id but no files and no dist/ folder.

I also tried creating an empty dist/ but... 

 

Thanks for any suggestion!!!

 

S.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 31, 2022

Hi S,

Thanks for the info. As a next step, I would suggest debugging this locally with Docker to figure out if the issue occurs in Pipelines only or not.

You can do this the following way:

1. Take a new clone of the repo on your machine

2. Navigate to the directory of that new clone, and do a git reset --hard to the commit of the build with the issue (if it's not the latest commit in your repo).

3. Afterwards, start a Docker container with the following command

docker run -it --volume=/Users/myUserName/code/my-repo:/localDebugRepo --workdir="/localDebugRepo" --memory=4g --memory-swap=4g --memory-swappiness=0 --cpus=4 --entrypoint=/bin/bash wagnerstephan/bitbucket-git-ftp:latest

Replace /Users/myUserName/code/my-repo in the command with the path of the clone you took in step 1.

4. After the Docker container starts, you can run the commands of the script in your yml file (replace the variable names with their actual values, as these variables won't be available locally) and see if you can push with the same command.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events