Bitbucket Pipeline with AWS EB and Wordpress

By Elastic Beanstalk, you can quickly deploy and manage applications in the AWS Cloud without worrying about the infrastructure that runs those applications.

  1. create a repository on the bitbucket with Wordpress code in it or you can use the existing repository.
  2. Then you need enable the pipeline from the bitbucket if it is not already enabled. To enable the pipeline you need to go to your
    repository settings->Pipeline setting->Enable piplines
  3. Then you can go to the pipelines from the repository to write the YAML configuration for the pipeline or you can create the file from your editor as bitbucket-pipelines.yml and commit that file to the repository.

I suppose you already have the beanstalk environment in your AWS account if not create it for the PHP application.

Then just copy the below code, put it in bitbucket-pipelines.yml and replace it with the appropriate variables from your AWS account and make sure indentation is correct.

Basic usage variables

  • AWS_ACCESS_KEY_ID (*): Your AWS access key.
  • AWS_SECRET_ACCESS_KEY (*): Your AWS secret access key.
  • AWS_DEFAULT_REGION (*): The AWS region code (us-east-1, us-west-2, etc.) of the region containing the AWS resource(s). For more information, see Regions and Endpoints.
  • APPLICATION_NAME (*): The name of the Elastic Beanstalk application.
  • COMMAND (*): Command to be executed during the deployment. Valid options are all, upload-only, deploy-only. Default: all.
  • ENVIRONMENT_NAME (*): Environment name.
  • ZIP_FILE (*): The application source bundle to deploy (zip, jar, war).
  • S3_BUCKET: Bucket name used by Elastic Beanstalk to store artifacts. Default: ${APPLICATION_NAME}-elasticbeanstalk-deployment}
  • VERSION_LABEL: Version label for the new application revision. Default: ${ENVIRONMENT_NAME}_${BITBUCKET_COMMIT:0:8}_YYYY-mm-dd_HHMMSS).
  • WAIT: Wait for deployment to complete. Default: false.
  • WAIT_INTERVAL: Time to wait between polling for deployment to complete (in seconds). Default: 10.
  • DEBUG: Turn on extra debug information. Default: false.
  • (*) = required variable.

Note: Deploy your version deploy-$BITBUCKET_BUILD_NUMBER-multiple into the environment production and wait until the deployment to complete.


image: atlassian/default-image:2

- step:
- composer
- apt-get update
- apt-get install -y zip
- zip -r .
- pipe: atlassian/aws-elasticbeanstalk-deploy:1.0.2
WAIT: 'true'



#DevOps — #AWS — #Cloud enthusiast.. Views are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store