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 https://confluence.atlassian.com/x/14UWN 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

pipelines:
  default:
    - step:
        caches:
          - 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 ftp://mywebsite.com/public_html/mydirectory

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,
Lars

2 answers

I found this comment that said No, https://www.savjee.be/2016/06/Deploying-website-to-ftp-or-amazon-s3-with-BitBucket-Pipelines/#comment-3160331772

 

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.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Meg Holbrook
Posted yesterday in Off-topic

Miscellaneous Monday - Throwback Edition

It's Monday morning here is sunny California! (86 degrees in April, what is happening right now??) Time for another Miscellaneous Monday! I was having a random conversation with my nine-year-old thi...

2,535 views 35 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you