
This section outlines the branching strategy and the overall CI/CD pipeline. We utilize a Git flow-inspired approach.

CI/CD Pipeline Overview:

This section details the AWS infrastructure and specific requirements for the CI/CD pipeline.

AWS Services:
CI/CD Pipeline Requirements:

This section describes the MongoDB setup.
bash#!/bin/bash## inputDATABASE_CONNECTION_STRING="$1"if [ -z $DATABASE_CONNECTION_STRING ]; thenecho "Require DATABASE_CONNECTION_STRING! exit"exit 1fi## defaultMIGRATE_MONGODB_DIR="./mongodb-migrations"MIGRATE_MONGO_NPM_VERSION="11.0.0"export DATABASE_CONNECTION_STRING="${DATABASE_CONNECTION_STRING}"if [ -d $MIGRATE_MONGODB_DIR ]; then# go to mongodb-migrations directorycd $MIGRATE_MONGODB_DIR# install migrate-mongo npm packagenpm install -g migrate-mongo@${MIGRATE_MONGO_NPM_VERSION}# start migrationmigrate-mongo up# check migration statusif [ $? != 0 ]; thenecho "Migrate mongodb failed!"exit 1fiecho "Migrate mongodb successfully!"migrate-mongo statuselseecho "${MIGRATE_MONGODB_DIR} not found! Skip!"fi
This section outlines the requirements for using Terraform to manage infrastructure.
This section provides a step-by-step guide on deploying services to the ECS cluster.
json"<service_name>": {"service_ports" : [3000], #--> default port for service (keep it by default)"security" : "low", #--> set log retention days, refer README.md in terraform for more details."service_enable_autoscaling" : true, #--> set autoscaling, should be enabled (keep it by default)"service_discovery_dns_record_a_ttl": 60, #--> ttl for private dns records (keep it by default)"task_role_name" : "ecs-execution-role", #--> the task role for ecs service"execution_role_name" : "ecs-execution-role", #--> the service role for ecs service"service_health_check_path" : "/<service_name>/healthcheck", #--> the healthcheck path name of public API endpoint. For example: <leaderboard>: https://api-uat.claynosaurz.com/leaderboard/healthcheck"leaderboard_config_path_pattern" : "/<service_name>/*", #--> the path name of public API endpoint. For example: <leaderboard>: https://api-uat.claynosaurz.com/leaderboard/*"task_container_definitions" : [{"name" : "<service_name>-container", #--> this is name of service container. For example: <leaderboard>: 'leaderboard-container'"image" : "975050041486.dkr.ecr.us-east-1.amazonaws.com/claynosaurz-<env>-<service_name>:<tag_version>", #--> image ECR url. The tag version, you can use 'latest' and update after the image was built and pushed to ECR."environment" : #--> Environments for ecs service. In details, gameloft will share the list env.{"SERVICE_NAME": "leaderboard","ENV": "uat","PORT": "3000","DATABASE_CONNECTION_LIMIT": "100","DEBUG_ENABLE_DATABASE_QUERY_LOG": "1","DEBUG_ENABLE_DATABASE_ERROR_LOG": "1","DEBUG_ENABLE_HTTP_REQUEST_BODY_LOG": "1","DEBUG_ENABLE_HTTP_REQUEST_HEADERS_LOG": "1","DISABLE_PRETTY_LOGGER": "1","DISABLE_HEALTHCHECK_LOG": "1","CORS_ORIGINS": "*","APP_REQUEST_TIMEOUT": "30","PATH_PREFIX": "leaderboard","DEBUG_ENABLE_SWAGGER": "1","REFRESH_TOKEN_EXPIRES_IN": "86400","ACCESS_TOKEN_EXPIRES_IN": "600","ADDITIONAL_LOG_REDACT_KEYS": "*","APM_ENABLE": true,"SENTRY_ENVIRONMENT": "leaderboard.uat"},"secrets" : #--> This is a secrets of services. Similar to environments, gameloft will share it.["DATABASE_CONNECTION_STRING","DATA_TRANSFER_KEY","DATA_TRANSFER_IV","INTERNAL_KEY","SENTRY_DSN","REDIS_CONNECTION_STRING_READ","REDIS_CONNECTION_STRING_WRITE"],"ports" : [3000], #--> port for this container. One service is able to contains multiple containers with different ports."vars" : {"linuxParameters" : { "initProcessEnabled" : true }, #--> keep it by default"private_registry" : false #--> set true if you are using the docker private registry.}}]}
This section describes the CI/CD workflow specifically for the CMS frontend, likely deployed using Vercel.

This section describes the CI/CD workflow for the backend services, deployed to the ECS cluster. This workflow is similar to the general CI/CD pipeline described in 1.23.4.1, but with specifics for backend services.


Microservices have become a popular architectural style for building large-scale and complex applications. One of the key aspects of microservices is how they communicate with each other. In this blog post, we'll explore different communication patterns used in microservices and take a closer look at REST APIs, which are widely used for inter-service communication. We'll also discuss the advantages and disadvantages of using REST APIs based on my experience in a current project.
Beiryu
Contributor

The tutorial outlines how to integrate Jenkins and Slack for monitoring CI/CD pipelines. It involves setting up a custom Slack app to receive messages from Jenkins, configuring Jenkins with the Slack Notification plugin, and adding the OAuth token from Slack as a secret text credential in Jenkins. Both traditional Jenkins jobs and Jenkins pipelines can be configured to send Slack notifications, with pipeline scripts used to send messages in the latter case.
Beiryu
Contributor