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

Pipeline - Build and deploy using node / gulp / git ftp

Hey everyone,

I noticed yesterday that BitBucket supported CICD pipelines, which is an amazing feature i'm eager to use.

I have however some difficulty setting it up.

My building process in general:

  • npm install
  • npm install -g bower
  • bower install
  • npm instlal -g gulp
  • gulp

The gulp command is building the HTML application and places the output to a 'build' folder. After the build has been completed, I'd like the code to be transfered to a directory on my website.

This translates to the following bitbucket.yml:

# This is a sample build configuration for JavaScript.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:6.9.4

    - step:
          - node
        script: # Modify the commands below to build your repository.
          - npm install
          - npm install -g bower
          - bower install --allow-root
          - npm install -g gulp
          - gulp
          - cd build
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD

The issue i'm getting is that the git ftp init seems to be uploading the src folder, and not the contents of the 'build' one which is created in the gulp step.

Any ideas?

Kind regards,

3 answers

As I posted in this Github thread, while `git-ftp` is designed to only deploy tracked file changes, it is actually possible to deploy your entire `dist` folder on every commit, even if these files are untracked.

You first need to create a file called `.git-ftp-include` in the root of your repo, and add a single line with the path to your dist folder, ensuring you add `!` to the start of the line:


You *should* (in theory) be able to then run `git ftp push` but for some reason this doesn't always upload the `dist` folder. I needed to run `git ftp push --all` which uploads ALL your files (even unchanged ones).

I think what you are looking for is adding another parameter

--syncroot : Specifies a local directory to sync from as if it were the git project root path.

I found this comment that said No,


I found your post and I am having the same issue. I'm trying some additional configs adding the build destination .git-ftp-include.

If I get anywhere I'll update with an answer.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in DevOps

GitHub Script with GitHub Actions Automating Workflows

Hello folks, This is a series of articles where I explain GitHub Script with GitHub Actions and how you can automate publishing data on Atlassian & GitHub Platform based on the results of Workf...

213 views 1 2
Read article

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