DEV Community

Cover image for How to implement Laravel CI/CD with Bitbucket and AWS
Shpëtim Islami ⚡
Shpëtim Islami ⚡

Posted on

How to implement Laravel CI/CD with Bitbucket and AWS

If you never did CI/CD implementation of your Laravel project before, then start with Bitbucket pipelines because its easy.

If you did CI/CD implementation of Laravel before then use Bitbucket pipelines because it has a lot of free build time.

Now lets get into it..

Here in line 5 under branches we say when commit is pushed to master branch to run the following:

Create 2 zip files excluding the vendor folder, and they both run in parallel defined by the parallel tag on line 6.

Then again in line 19 we define 2 processes to run in parallel, they deploy to 2 different beanstalk environments. 1 is for web serving instance/s and the other is for the queue instance/s.

To use this you will need to:

  • Create 1 application in AWS Beanstalk with 2 environments (web and queue worker).
  • Create an S3 bucket
  • Obtain your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION

replace them with the placeholders and add this file called bitbucket-pipelines.yml into the root of your projects git repository.

If you followed this how to guide, when you push something to master this is how it looks like in Bitbucket:

Alt Text

The next step would be that you run unit tests before the deployment steps.

Have a happy deployment, cheers.

Top comments (1)

Collapse
 
somtee99 profile image
Somtoo Okafor

Really helpful, thanks a lot