Created 2017.05.30
https://www.savjee.be/2016/06/Deploying-website-to-ftp-or-amazon-s3-with-BitBucket-Pipelines/
First up, create the Environment variables in your Bitbucket account:
FTP_USERNAME_DEV
: As generated by SitehostFTP_PASSWORD_DEV
: As generated by SitehostFTP_SERVER_PATH_DEV
:ftp://120.138.19.15/public/
(for Sitehost)
This is the bitbucket-pipelines.yml
file that I use in all Bitbucket projects:
# Bitbucket Pipeline configuration
# Runs on a Docker image
# Note: use only spaces to indent
#
# See https://www.savjee.be/2016/06/Deploying-website-to-ftp-or-amazon-s3-with-BitBucket-Pipelines/
# See https://confluence.atlassian.com/x/5Q4SMw for more examples.
#
# Uses https://github.com/git-ftp/git-ftp
# Initial upload of all files:
# - git ftp init --user $FTP_USERNAME_DEV --passwd $FTP_PASSWORD_DEV $FTP_SERVER_PATH_DEV
# Update with only files from the latest commit:
# git ftp push --user $FTP_USERNAME_DEV --passwd $FTP_PASSWORD_DEV $FTP_SERVER_PATH_DEV
image: samueldebruyn/debian-git
pipelines:
branches:
development:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $FTP_USERNAME_DEV --passwd $FTP_PASSWORD_DEV $FTP_SERVER_PATH_DEV
I have a client that uses GoDaddy's WordPress Managed Hosting. Initially I had problems getting this to work with GoDaddy, and I tried all sorts of path combinations before I realised what the problem was:
- GoDaddy uses SFTP, so you must use the
sftp://
protocol in your Bitbucket environmental variable. notftp://
- SSH must be enabled in GoDaddy's Basic settings
- The path is
/home/SFTPusername/html/wp-content/themes/mytheme
(this was already correct)