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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket-AWS Codedeploy: Deploy in 2 different folders in 1 EC2 instance

I deploy using Bitbucket and AWS CodeDeploy. I have 1 EC2 instance which hosts several websites (staging and production). I also have 2 branches in Bitbucket, develop and master. I configured Bitbucket to deploy to develop and I want the files to go to /var/www/vhosts/staging.com/httpdocs/ directory and when I deploy to master, files should go to /var/www/vhosts/production.com/httpdocs/ directory on the EC2 instance.

I'm only using 1 deployment group.

How can I achieve this?

1 answer

1 accepted

0 votes
Answer accepted

This is merely a question about AWS CodeDeploy and the docs suggest to make use of multiple deployment groups for the different environments.

The general suggestion is also to not have different environments on the same instance.

However this must not mean that it would not be technically possible. E.g. you can hardencode the environment into the deployment package and when the appspec.yml hooks are fired to take care to copy the application files into the folder of your whish.

From your follow up question it looks to me that you already figured the part out about the deployment groups. Have you managed the different target folders in the life-cycle hooks so far as well? Or did you find a different solution? Please share.

I deployed using two different deployment groups. I first send the files in a temporary folder inside the domain (/var/www/vhosts/example.com/temp/) then configured my after_install script to copy those files inside /temp and send the files to the appropriate directories inside the same domain. /var/www/vhosts/example.com/staging.com/ and /var/www/vhosts/example.com/httpdocs/. This is still work in progress btw.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

130 views 2 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you