Skip to content

Instantly share code, notes, and snippets.

@atazmin
Last active May 11, 2020 03:55
Show Gist options
  • Save atazmin/f08e284ac85a1a82fbd18c946ce64809 to your computer and use it in GitHub Desktop.
Save atazmin/f08e284ac85a1a82fbd18c946ce64809 to your computer and use it in GitHub Desktop.

Bitbucket pipelines sync subfolder/subdirectory, video description YouTube

Git FTP https://github.com/git-ftp/git-ftp

Manual https://github.com/git-ftp/git-ftp/blob/master/man/git-ftp.1.md --syncroot : Specifies a local directory to sync from as if it were the git project root path.


bitbucket-pipelines.yml

image: php:7.1.24

pipelines:
  branches:
   master:
     - step:
         name: Deploy to production
         deployment: production
         script:
           - apt-get update
           - apt-get -qq install git-ftp
           #- git ftp init --user $FTP_USERNAME_PROD --passwd $FTP_PASSWORD_PROD ftp://ftp.evareynoldsfinearts.com/ --syncroot web #commented out after first deploy
           - git ftp push --user $FTP_USERNAME_PROD --passwd $FTP_PASSWORD_PROD ftp://ftp.evareynoldsfinearts.com/ --syncroot web #uncommented out after first deploy
   develop:
     - step:
         name: Deploy to staging
         deployment: staging
         script:
           - apt-get update
           - apt-get -qq install git-ftp
           #- git ftp init --user $FTP_USERNAME_STAGE --passwd $FTP_PASSWORD_STAGE ftp://ftp.evareynoldsfinearts.com/ --syncroot web #commented out after first deploy
           - git ftp push --user $FTP_USERNAME_STAGE --passwd $FTP_PASSWORD_STAGE ftp://ftp.evareynoldsfinearts.com/ --syncroot web #uncommented out after first deploy

Optional ignore file for git-ftp .git-ftp-ignore

bitbucket-pipelines.yml
web/.htaccess.sample
web/wp-config.sample.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment