- cd wp-content/themes/sage
- yarn install
- yarn run build:production
- apt-get install lftp
- lftp -d -u $PREPROD_FTP_USERNAME,$PREPROD_FTP_PWD -e "set ssl:verify-certificate no ; mirror -e -R ./dist/ /wp-content/themes/sage/dist/ ; quit" ftp://$PREPROD_FTP_ADDRESS
- You might have to do so with
composer install for the
vendor folder (not needed in my case)
- Here I'm only pushing
dist files because the website is deployed with git (using the plugin Revisr with Bitbuckets webhooks).
- Note that the FTP connection is not secured
- I'm using Bitbucket Pipelines environment variables for FTP credentials
If you're still using
git-ftp, the latest version allows to
push --auto-init: https://github.com/git-ftp/git-ftp/pull/331. This way you don't have to
init, which push all files every time.