Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket deployment to Drupal on Amazon E2C

Deleted user April 4, 2019

I'm trying to figure out how to create a bitbucket-pipeline file that will update my Drupal application on an Amazon EC2 instance.

So far, the bitbucket-pipelines I've created have either failed or never complete.

I can't find any instructions that cover this exact instance and have been cobbling this together out of information from both Amazon and Atlassian.

An example yml file would be wonderful!

 

Thanks,

 

Mjm

1 answer

1 accepted

0 votes
Answer accepted
Deleted user April 13, 2019

This is what I've come up with after several days to copy a Drupal application from bitbucket to EC2.  This does not result in a functioning site - pretty sure I need to run Composer somewhere.

Keep in mind there are numerous other things that need to be set up before this will work.

bitbucket-pipelines.yml

- All $values set in Atlassian repository variables

- Could not figure out how to paste with indentation intact

- Set "myversionlabel-1.0" on the target instance with the following:

aws deploy register-application-revision \
--application-name [application name set in Code Deploy] \
--description "Description" \
--s3-location bucket=[custom bucket name],key=myversionlabel-1.0,bundleType=zip
image: php:7.2.14

pipelines:
default:
- step:
name: Updating and installing
script:
- echo "Updating and installing zip"
- apt-get update && apt-get install -y zip
- echo "Zipping directory"
- zip -r stage_deploy.zip ./appspec.yml ./docroot
artifacts:
- stage_deploy.zip
- step:
name: S3 and Code Deploy
deployment: staging
script:
- pipe: atlassian/aws-code-deploy:0.2.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION

COMMAND: 'upload' # 'upload' or 'deploy'.
ZIP_FILE: 'stage_deploy.zip'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'myversionlabel-1.0'

- pipe: atlassian/aws-code-deploy:0.2.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
APPLICATION_NAME: $APPLICATION_NAME
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
COMMAND: 'deploy'
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP_NAME
WAIT: 'true'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'myversionlabel-1.0'

 EDIT: Add appspec.yml file

# This is an appspec.yml template file for use with an EC2/On-Premises deployment in CodeDeploy.
# The lines in this template starting with the hashtag symbol are
# instructional comments and can be safely left in the file or
# ignored.
# For help completing this file, see the "AppSpec File Reference" in the
# "CodeDeploy User Guide" at
# https://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events