June 23, 2020 / Nirav Shah
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.
Also Read: Enabling root login to the server with SSH login
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.