Hi,
I currently have a .yml file that pushes changes I make to my repository to an FTP. What I would like to do is edit it so that only changes made to the master branch is pushed to FTP - is this possible? Here is the .yml file:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN 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: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git-ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD wetcheck.com.au
Also, what would be great is if there was even a staging branch so that changes made on the staging branch would be pushed to one FTP folder and changes made to the master would be pushed to another FTP folder.
Any input on this would be much appreciated.
Thanks!
Hi Kosta,
You can define branch requirements on a pipeline. See the documentation here for details: https://confluence.atlassian.com/bitbucket/branch-workflows-856697482.html
For example, you can change your configuration to this instead:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN 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: samueldebruyn/debian-git
pipelines:
branches:
master:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git-ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD wetcheck.com.au
staging:
- step:
script:
- #something staging specific
default:
- step:
script:
- # all other branches will run this pipeline. For example, you may want to just check tests still pass on your branches.
Thanks,
Phil
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.