June 23, 2020 / Eternal Team
Do you have a PHP project in bitbucket and you wanted to know how to set up your bitbucket Auto pipeline to push the PHP files directly on AWS EC2. So here you go.
Assumption
So here we have set up simple “production” branch pipeline bitbucket-pipelines.yml
pipelines: default: - step: name: Push script: # Build and push image - pipe: atlassian/rsync-deploy:0.4.3 variables: USER: 'ubuntu' SERVER: ‘XX.XX.XX.XX’ REMOTE_PATH: '/var/www/yourwebsite.com' LOCAL_PATH: ${BITBUCKET_CLONE_DIR}/* SSH_KEY: $MY_SSH_KEY DEBUG: 'true'
rsync-deploy is famous for its data transfer algorithms, which reduces the data transfer by sending only differences between source files in the destination. So it’s faster.
Core PHP doesn’t require any kind of build or third party dependency installation, so its simple.
Please configure your SSH_KEY inside your repository section settings.