mirror of
				https://github.com/lingble/twenty.git
				synced 2025-11-03 22:27:57 +00:00 
			
		
		
		
	Merge pull request #10 from twentyhq/charles-bochet-circleci
Add CI and CD to the project
This commit is contained in:
		
							
								
								
									
										67
									
								
								.circleci/config.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								.circleci/config.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
				
			|||||||
 | 
					version: 2.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orbs:
 | 
				
			||||||
 | 
					  aws-ecr: circleci/aws-ecr@8.2.1
 | 
				
			||||||
 | 
					  aws-ecs: circleci/aws-ecs@03.2.0
 | 
				
			||||||
 | 
					  slack: circleci/slack@4.12.0
 | 
				
			||||||
 | 
					  node: circleci/node@5.0.3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  tests:
 | 
				
			||||||
 | 
					    executor: node/default
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - checkout
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          command: cd front && npm install
 | 
				
			||||||
 | 
					          name: install node dependencies
 | 
				
			||||||
 | 
					      - run:
 | 
				
			||||||
 | 
					          command: cd front && npm run test
 | 
				
			||||||
 | 
					          name: tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					workflows:
 | 
				
			||||||
 | 
					  build-and-deploy:
 | 
				
			||||||
 | 
					    jobs:
 | 
				
			||||||
 | 
					      - tests
 | 
				
			||||||
 | 
					      - aws-ecr/build-and-push-image:
 | 
				
			||||||
 | 
					          filters:
 | 
				
			||||||
 | 
					            branches:
 | 
				
			||||||
 | 
					              only: main
 | 
				
			||||||
 | 
					          requires:
 | 
				
			||||||
 | 
					            - tests
 | 
				
			||||||
 | 
					          dockerfile: Dockerfile
 | 
				
			||||||
 | 
					          registry-id: AWS_ACCOUNT_ID
 | 
				
			||||||
 | 
					          aws-access-key-id: AWS_ACCESS_KEY_ID
 | 
				
			||||||
 | 
					          aws-secret-access-key: AWS_SECRET_ACCESS_KEY
 | 
				
			||||||
 | 
					          region: $AWS_REGION
 | 
				
			||||||
 | 
					          repo: $AWS_ECR_REPO
 | 
				
			||||||
 | 
					          tag: $CIRCLE_SHA1
 | 
				
			||||||
 | 
					      - aws-ecs/deploy-service-update:
 | 
				
			||||||
 | 
					          name: deploy-canary
 | 
				
			||||||
 | 
					          requires:
 | 
				
			||||||
 | 
					            - aws-ecr/build-and-push-image
 | 
				
			||||||
 | 
					          family: $AWS_ECS_CONTAINER_NAME_CANARY
 | 
				
			||||||
 | 
					          cluster: $AWS_ECS_CLUSTER
 | 
				
			||||||
 | 
					          container-image-name-updates: "container=$AWS_ECS_CONTAINER_NAME_CANARY,tag=${CIRCLE_SHA1}"
 | 
				
			||||||
 | 
					      - slack/on-hold:
 | 
				
			||||||
 | 
					          name: slack-notification
 | 
				
			||||||
 | 
					          context: slack-secrets
 | 
				
			||||||
 | 
					          requires:
 | 
				
			||||||
 | 
					            - deploy-canary
 | 
				
			||||||
 | 
					      - hold:
 | 
				
			||||||
 | 
					          type: approval
 | 
				
			||||||
 | 
					          requires:
 | 
				
			||||||
 | 
					            - slack-notification
 | 
				
			||||||
 | 
					      - aws-ecs/deploy-service-update:
 | 
				
			||||||
 | 
					          name: deploy-prod
 | 
				
			||||||
 | 
					          requires:
 | 
				
			||||||
 | 
					            - hold
 | 
				
			||||||
 | 
					          family: $AWS_ECS_CONTAINER_NAME_DEFAULT
 | 
				
			||||||
 | 
					          cluster: $AWS_ECS_CLUSTER
 | 
				
			||||||
 | 
					          container-image-name-updates: "container=$AWS_ECS_CONTAINER_NAME_DEFAULT,tag=${CIRCLE_SHA1}"
 | 
				
			||||||
 | 
					          post-steps:
 | 
				
			||||||
 | 
					            - slack/notify:
 | 
				
			||||||
 | 
					                event: pass
 | 
				
			||||||
 | 
					                template: basic_success_1
 | 
				
			||||||
 | 
					            - slack/notify:
 | 
				
			||||||
 | 
					                event: fail
 | 
				
			||||||
 | 
					                template: basic_fail_1
 | 
				
			||||||
@@ -25,7 +25,7 @@
 | 
				
			|||||||
    "eject": "react-scripts eject",
 | 
					    "eject": "react-scripts eject",
 | 
				
			||||||
    "storybook": "start-storybook -p 6006 -s public",
 | 
					    "storybook": "start-storybook -p 6006 -s public",
 | 
				
			||||||
    "build-storybook": "build-storybook -s public",
 | 
					    "build-storybook": "build-storybook -s public",
 | 
				
			||||||
    "coverage": "react-scripts test --coverage"
 | 
					    "coverage": "react-scripts test --coverage --watchAll"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "eslintConfig": {
 | 
					  "eslintConfig": {
 | 
				
			||||||
    "extends": [
 | 
					    "extends": [
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user