{"id":21322104,"url":"https://github.com/advantageous/ecs-deployer","last_synced_at":"2025-03-15T22:44:52.417Z","repository":{"id":77190980,"uuid":"150243208","full_name":"advantageous/ecs-deployer","owner":"advantageous","description":"Deploy microservices to ECS","archived":false,"fork":false,"pushed_at":"2018-10-15T20:57:09.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T11:47:58.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/advantageous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-25T09:51:56.000Z","updated_at":"2018-10-15T20:57:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"63f8be84-6b94-47a9-a14c-643786f10833","html_url":"https://github.com/advantageous/ecs-deployer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fecs-deployer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fecs-deployer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fecs-deployer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fecs-deployer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/advantageous","download_url":"https://codeload.github.com/advantageous/ecs-deployer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801612,"owners_count":20350106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T20:13:17.902Z","updated_at":"2025-03-15T22:44:52.404Z","avatar_url":"https://github.com/advantageous.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ECS Automation for CI/CD\n## Provisioning\nCreate ECS service and related resources in AWS.\n#### Usage:\n\n    ecs-deployer/bin/provision.sh [-h] -e env-name\n    \n#### Options:\n* -h: Displays this information.\n* -e: Target environment. Required.\n\n## Deployment\nDeploy updated service in ECS.\n#### Usage:\n\n    ecs-deployer/bin/deploy.sh [-h] [-v] [-d] [-e env-name] -t docker-tag\n\n#### Options::\n* -h: Displays this information.\n* -v: Verbose mode on.\n* -d: Dry run.  AWS commands will not be executed.\n* -t: Docker tag to deploy. Required.\n* -e: Deployment environment.\n\n#### Examples:\n\n    # Automatically determine the target environment from the branch and deploy the \"latest\" tag.\n    ecs-deployer/bin/deploy.sh -t latest\n\n    # Dry run with verbose output for the 1.3.4 tag.\n    ecs-deployer/bin/deploy.sh -t 1.3.4 -v -d\n\n## Configuration\nThis script requires a .deployrc configuration file. This file should be placed in the directory which the script is run. This is typically the root of your project beside your .travis.yml or Jenkinsfile.\nYou may also specify environment-specific parameters in their own .deployrc.env_name files.  For example you can create a .deployrc.prod and its values will override the main one when deploying to a environment named prod.\n\nIt is important note that the name, region, and cluster can not be changed once the service is created.\n\nThe following parameters must be contained either in the .deployrc file or the environment-specific rc file:\n\n    name=my-service\n    region=us-west-2\n    cluster=arn:aws:ecs:us-west-2:123456789012:cluster/my-cluster\n    repo=123456789012.dkr.ecr.us-west-2.amazonaws.com/my-service\n    subnets=subnet-4cfd6c2a,subnet-53a6101b\n    security_groups=sg-6ba62416\n    iam_role=arn:aws:iam::123456789012:role/ecsTaskExecutionRole\n    vpc_id=vpc-6b8ac90d\n    listener_rule=\"Field=host-header,Values=myservice.mydomain.com\"\n    listener_rule_priority=10\n    listener_arn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/int-rbcm/cbb0779036bb392e/fa1d65163f86dc2e\n\nThe following parameters are optional and will default to these values:\n\n    cpu=1024\n    memory=2048\n    port=8080\n    task_count=2\n    lb_health_start_period=120\n    lb_health_path=/\n    container_health_command=\"true\"\n    container_health_interval=10\n    container_health_timeout=5\n    container_health_retries=5\n    container_health_start_period=90\n    dockerfile_path=\".\"\n    log_retention_days=7\n\nYou may also set env vars by prefixing the var name with env_\n\n    env_SPRING_PROFILES_ACTIVE=production\n    env_deploy_time=`date`\n\n## Travis and Jenkins Integration\nThe deploy script is aware of Travis and Jenkins ENV vars to give it clues on how to automatically deploy.\nThis is based off of the deployment schema that I use on all my other projects.\n\nOn my team, developers work in feature branches and merge to a branch called \"integration\" to integrate and test their\nchanges with the team. Integration commits/merges are automatically deployed to the integration environment.  Every\nmerge requires a version bump in the gradle build file (for Java/Kotlin projects) or the package.json (for node.js).\nI use these versions to tag the docker images and then it's always easy to tell what is in any env, what feature train\nit is on, etc.\n\nA typical travis.yml looks like this:\n\n    language: java\n    sudo: required\n    services:\n      - docker\n    before_cache:\n      - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock\n      - rm -fr $HOME/.gradle/caches/*/plugin-resolution/\n    cache.directories:\n      - $HOME/.gradle/caches/\n      - $HOME/.gradle/wrapper/\n    script:\n      - ./gradlew build\n    after_success:\n      - git clone https://github.com/advantageous/ecs-deployer.git\n      - ecs-deployer/bin/deploy.sh -t `egrep '^version = ' build.gradle.kts | sed -e 's/\"//g' | cut -d \"=\" -f 2 | xargs`\n\n\nWhen the feature is done and ready for QA, it is merged to the master branch. Merges to master are automatically\ndeployed ot the staging environment for QA.  When QA certifies the version that's deployed new tags are cut in docker\nand git and they are deployed to production.\n\nAnd Bob's your uncle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fecs-deployer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvantageous%2Fecs-deployer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fecs-deployer/lists"}