1

I just set up a CI-CD pipeline from AWS to github for my laravel project. I'm no expert in CI-CD or devops. It appears that code deploy is always success in aws pipeline even if I set a unit test false or test fails. Please see the image.code

You can see the test failed & also deploy succeeded in aws. I don't fully understand how it works. Also can I set conditions maybe in tests that when should github deploy the codes in aws or any idea how the tests works for CI-CD in laravel? Thanks! enter image description here enter image description here

Rana
  • 11
  • 3

1 Answers1

0

trigger aws code-deploy from GitHub action workflow. You Only have CI part in your yml file.

see yml file for GitHub action in here

https://medium.com/thelorry-product-tech-data/amazon-ec2-deployment-complete-ci-cd-pipeline-using-github-actions-and-aws-codedeploy-8a477123ff7e

Tipu Sultan Eiko
  • 677
  • 4
  • 10
  • Ok I read it. But it configured the yml file for python. Can you help me how it should look like for laravel? – Rana Jul 07 '23 at 12:53
  • check here https://medium.com/geekculture/continuous-integration-with-laravel-and-github-actions-b30b11fbd995 basically, you need to set up laravel, composer, database, and run PHPUnit in there, if the PHP unit fails then CI fails. CD part should look similar PHPUnit is not the only option, but it is mostly used one – Tipu Sultan Eiko Jul 10 '23 at 23:35
  • thanks for reply! I did it two part if CI passes then CD proceeds. My CI passes but CD fails, I used below code to inside CD to deploy --application-name JitumeCICD \ --deployment-group-name JitumeCICDGroup \ --deployment-config-name CodeDeployDefault.OneAtATime \ Error is: "(DeploymentLimitExceededException) when calling the CreateDeployment operation: The Deployment Group 'JitumeCICDGroup (id=fdd0acea-3f3a-43d5-a362-ffd192064486)' already has an active Deployment 'd-O49ETHLE1' " I don't know why , I tried to change to config to AllAtOnce. don't work, please help! – Rana Aug 30 '23 at 15:05
  • Also if I again include the appspec.yml as well, then everything is ok, CI passes, CD passes, code deploys. But code deploys no matter if all tests pass or not, no matter CI/CD passes or not. – Rana Aug 30 '23 at 15:17