advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
Reads:528Replies:11

How to configure ECS for CI/CD with bitbucket pipeline

Created#
More Posted time:Jul 4, 2019 10:20 AM
Hello,
Anyone can help me to give step by step or best practice how to configure ECS for CI/CD with Bitbucket pipeline?
I have bibucket repo and I want to use bitbucket pipeline to CI/CD to my ECS.


Thanks

roura
Assistant Engineer
Assistant Engineer
  • UID5629
  • Fans4
  • Follows2
  • Posts39
1st Reply#
Posted time:Jul 16, 2019 13:01 PM
It is, I submitted a request for that pipe to exist. Hopefully they will consider it. For now, pure SSH automation it is :)
https://cirrusaudit.com

advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
2nd Reply#
Posted time:Jul 15, 2019 23:52 PM
Thanks for the answer roura.
It's a bit sad because there is no integration between alibaba clouds with bitbucket like they have with gitlab and github. currently I update the server manually with running git pull then run the magento command.

roura
Assistant Engineer
Assistant Engineer
  • UID5629
  • Fans4
  • Follows2
  • Posts39
3rd Reply#
Posted time:Jul 13, 2019 16:12 PM
Pushing from Bitbucket to Magento running on ECS
First of all, I'd recommend you to read the "Get started with Bitbucket pipelines", a really good read from Bitbucket itself.

Now, Magento makes things a bit different that other platforms and there is a lot more moving parts than usual. Because this, I'd recommend you to keep your local environment up to date with production or, at least, a staging environment to keep things in sync. This, of course, depends in how mission-critical is to keep the site as stable as possible. That will come down to your understanding of the business you are running on that online shop and how big the downtime windows can be.

Given that you are using Magento (v2 I suppose), if you keep the database and the "pub" folder mostly similar between production and your local machine, the only actual files you'll want to push using Bitbucket would be the theme folder itself, where your custom code and module overrides lives. So just by keeping in your repo the theme folder should be enough. For this, since there is still no Alibaba Cloud integration, you could go with "SFTP deploy" in a very simple way. From there, you could run the tests in your preferred way depending in the testing suite of your choice, using "SSH run".

To use both "SSH run" and "SFTP deploy" pipes, you need to append the Bitbucket SSH key to your `~/.ssh/authorised_keys` file. To be up to speed with how Bitbucket manages keys, check here how it works.

Once your code is in the production server, you would probably need to run (using "SSH run" pipe) a couple of console commands to clear the cache and set the whole thing again "ready to go". In my experience, the perfect combination of commands after I push changes are "bin/magento setup:upgrade", "bin/magento indexer:reindex", "bin/magento cache:enable" and "bin/magento cache:flush". In that specific order.
https://cirrusaudit.com

roura
Assistant Engineer
Assistant Engineer
  • UID5629
  • Fans4
  • Follows2
  • Posts39
4Floor#
Posted time:Jul 12, 2019 7:08 AM
Thank you for giving me some more context around your case. I'll get back to you shortly!
https://cirrusaudit.com

advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
5Floor#
Posted time:Jul 11, 2019 14:16 PM
Hi roura,
Here is my case. I have a magento project on my bitbucket repo. I want to deploy it in my ECS server. with bitbucket pipeline capability, if I make changes on the repo, it'd updated the server automatically. I dont know what setting need to be done on ECS to make this happen. Hopefully you can make best practice or tutorial about this. I got a similar tutorial with gitlab but I dont think i can follow the same thing with bitbucket pipeline.
Currently I dont use docker. I need to run test on the server.

roura
Assistant Engineer
Assistant Engineer
  • UID5629
  • Fans4
  • Follows2
  • Posts39
6Floor#
Posted time:Jul 11, 2019 10:19 AM
Hi advcha! I'm willing to help, but I'll need a bit of context to help you:
- Are you using Docker?
- Do you need to run tests?
https://cirrusaudit.com

advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
7Floor#
Posted time:Jul 10, 2019 14:21 PM
Dear Cloudy,
Any update about this topic?

Cloudy
Administrator
Administrator
  • UID63
  • Fans14
  • Follows1
  • Posts83
8Floor#
Posted time:Jul 5, 2019 17:43 PM
Dear advcha,
We are considering and making our effort to solve this problem with bitbucket pipeline. It may take us some time, so please kindly wait for it. Thanks.

advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
9Floor#
Posted time:Jul 5, 2019 15:13 PM
Hi Cloudy,
I really need it. Pls help

Cloudy
Administrator
Administrator
  • UID63
  • Fans14
  • Follows1
  • Posts83
10Floor#
Posted time:Jul 4, 2019 15:32 PM
Dear advcha,
Thank you for your question. We will provide related solutions or steps soon.

advcha
Intern
Intern
  • UID7636
  • Fans0
  • Follows0
  • Posts6
11Floor#
Posted time:Jul 4, 2019 10:24 AM
Sorry, If this post not in the proper place, please remove it. I dont know how to remove this post
Guest