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

Using Pipelines with git-ftp efficently Edited

Hi, I'm new to Bitbucket Pipelines. I have just started using it with git-ftp for deployments by following the tutorial here.

 

I currently have my bitbucket-pipelines.yml file like so:

image: samueldebruyn/debian-git

pipelines:
  branches: # matched against branches in your Git repository
    staging: # branch name
      - step:
          name: Get deploy sync list # files in .git-ftp-ignore should not be listed
          script:
            - apt-get update
            - apt-get -qq install git-ftp
            - git ftp push --dry-run --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://MY_SERVER # dry run so nothing is uploaded
      - step:
          name: Manually deploy staging
          deployment: staging
          trigger: manual # manually trigger the deployment if the sync list in the previous step looks good
          script:
            - apt-get update # QUESTION: is there a way to avoid being redundant on this?
            - apt-get -qq install git-ftp # QUESTION: is there a way to avoid being redundant on this?
            - git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://MY_SERVER

 

The first step lets me review my file change list before I deploy them. The second step lets me manually hit the deploy button if everything looks good.

 

My question is, is there a way to not have to re-install git-ftp in step 2? It feels redundant and a waste of build minutes to run 2 git-ftp related commands.

2 answers

You could just create your own docker image with git-ftp pre installed. This way you do not have to run

- apt-get update
- apt-get -qq install git-ftp

 

This will help you save on a few precious build minutes.

I like @Adarsh Kurudi idea and created an image with pre-installed git-ftp if anyone is interested: https://hub.docker.com/r/wagnerstephan/bitbucket-git-ftp

Suggest an answer

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

Atlassian supported Jenkins integration for Bitbucket Server

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our alpha is ready to download and install. It lets you seamlessly configure a Jenkins job ...

423 views 0 9
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