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

Using Pipelines with git-ftp efficently

kass-zgm June 13, 2018

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

3 votes
stephanwagner March 4, 2019

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

2 votes
Adarsh Kurudi August 20, 2018

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events