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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,713
Community Members
 
Community Events
176
Community Groups

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

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

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

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.

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

Atlassian Community Events