{"id":13879145,"url":"https://github.com/boltops-tools/cody","last_synced_at":"2025-06-28T17:03:27.350Z","repository":{"id":41433167,"uuid":"183333677","full_name":"boltops-tools/cody","owner":"boltops-tools","description":"Powerful DSL to easily create and manage AWS CodeBuild projects ","archived":false,"fork":false,"pushed_at":"2024-01-10T12:11:23.000Z","size":2380,"stargazers_count":19,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T01:06:06.482Z","etag":null,"topics":["aws","boltops","codebuild","ruby"],"latest_commit_sha":null,"homepage":"https://cody.run","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boltops-tools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"boltops-tools"}},"created_at":"2019-04-25T01:35:35.000Z","updated_at":"2024-05-13T04:22:49.000Z","dependencies_parsed_at":"2023-07-12T16:25:41.680Z","dependency_job_id":"cc9934c3-475e-472c-b80c-5f8ed12401d6","html_url":"https://github.com/boltops-tools/cody","commit_stats":null,"previous_names":["tongueroo/codebuild","tongueroo/cody"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/boltops-tools/cody","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcody","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcody/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcody/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcody/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boltops-tools","download_url":"https://codeload.github.com/boltops-tools/cody/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltops-tools%2Fcody/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262465657,"owners_count":23315633,"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":["aws","boltops","codebuild","ruby"],"created_at":"2024-08-06T08:02:11.173Z","updated_at":"2025-06-28T17:03:27.284Z","avatar_url":"https://github.com/boltops-tools.png","language":"Ruby","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"http://cody.run\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/tongueroo/cody/master/docs/img/logos/cody-with-text.png\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# Cody\n\n![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiWWFRbjVNQlIvZGtSS2NMTGlRY3pWYm1lTGFFSG5acDc4b09hL2lHWGVxeHZaMGYxVTc0cGEwOHBHWHF6MjZiNlZNU0JqS0lvTnZkdWI5enRDczRZYStnPSIsIml2UGFyYW1ldGVyU3BlYyI6ImsyUDJNc2E3SlpYOGFYYy8iLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)\n[![Gem Version](https://badge.fury.io/rb/cody.png)](http://badge.fury.io/rb/cody)\n\n[![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)\n\nPlease **watch/star** this repo to help grow and support the project.\n\nCody is an AWS CodeBuild Management Tool. Cody lets you create AWS CodeBuild projects with a beautiful DSL. The documentation site is at: [cody.run](https://cody.run/)\n\n## Quick Start\n\n    cody init\n    cody deploy\n    cody start\n    cody logs\n\n## Private Repo\n\nIMPORTANT: Before deploying, if you are using a private repo, use [aws codebuild import-source-credentials](https://docs.aws.amazon.com/cli/latest/reference/codebuild/import-source-credentials.html) to add credentials so that codebuild can clone down the repo.  Refer to the [CodeBuilld Github Oauth](https://cody.run/docs/github_oauth/) for more info.\n\n## Usage\n\n1. **init**: generate starter .cody files.\n2. **deploy**: deploy the CodeBuild project on AWS.\n3. **start**: kick off a CodeBuild project run.\n\n### Init and Structure\n\nFirst, run `cody init` to generate a starter `.cody` folder structure.\n\n    $ tree .cody\n    .cody\n    ├── buildspec.yml\n    ├── project.rb\n    └── role.rb\n\nFile | Description\n--- | ---\nbuildspec.yml | The build commands to run.  Here are the [buildspec.yml syntax docs](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html).\nproject.rb | The codebuild project written as a DSL. Here are the [Project DSL docs](https://cody.run/docs/dsl/project/)\nrole.rb | The IAM role associated with the codebuild project written as a DSL. Here are the [IAM Role DSL docs](https://cody.run/docs/dsl/role/)\n\n### Deploy\n\nAdjust the files in `.cody` to fit your needs. When you're ready, deploy the CodeBuild project with:\n\n    cody deploy PROJECT_NAME\n\nMore examples:\n\n    cody deploy # infers the CodeBuild project name from the parent folder\n    cody deploy PROJECT_NAME # explicitly specify project name\n\nIt is useful to just see the generated CloudFormation template with `--noop` mode:\n\n    cody deploy --noop # see generated CloudFormation template\n\nFor more help:\n\n    cody deploy -h\n\n### Start\n\nWhen you are ready to start a codebuild project run, you can use [codebuild start](https://cody.run/reference/cody-start/). Examples:\n\n    cody start # infers the name from the parent folder\n    cody start PROJECT_NAME # looks up project via CodeBuild project name\n\nThe `cody start` command understands multiple identifiers. It will look up the codebuild project either via CloudFormation or the CodeBuild project name.\n\nThe start command continuously polls the CodeBuild project and prints out the logs until the build completes. To disable this, use the `--no-wait` option.\n\n    cody start PROJECT_NAME --no-wait\n\nThe logs from the Phase Details and CloudWatch Logs are both displayed. Because they come from 2 different sources, the logs can interlace.\n\n## Project DSL\n\nThe tool provides a DSL to create a codebuild project.  Here's an example.\n\n.cody/project.rb:\n\n```ruby\n# name(\"demo\") # recommended to leave unset and use the conventional name that cody sets\ngithub_url(\"https://github.com/tongueroo/demo-ufo\")\nlinux_image(\"aws/codebuild/amazonlinux2-x86_64-standard:2.0\")\nenvironment_variables(\n  UFO_ENV: \"development\",\n  API_KEY: \"ssm:/codebuild/demo/api_key\" # ssm param example\n)\n```\n\nHere's a list of some of the convenience shorthand DSL methods:\n\n* github_url(url)\n* github_source(options={})\n* linux_image(name)\n* linux_environment(options={})\n* environment_variables(vars)\n* local_cache(enable=true)\n\nPlease refer to [lib/codebuild/dsl/project.rb](lib/codebuild/dsl/project.rb) for the full list.\n\nMore slightly more control, you may be interested in the `github_source` and `linux_environment` methods.  For even more control, see [DSL docs](https://cody.run/docs/dsl/).\n\n## IAM Role DSL\n\nCody can create the IAM service role associated with the codebuild project. Here's an example:\n\n.cody/role.rb:\n\n```ruby\niam_policy(\"logs\", \"ssm\")\n```\n\nFor more control, here's a longer form:\n\n```ruby\niam_policy(\n  action: [\n    \"logs:CreateLogGroup\",\n    \"logs:CreateLogStream\",\n    \"logs:PutLogEvents\",\n    \"ssm:*\",\n  ],\n  effect: \"Allow\",\n  resource: \"*\"\n)\n```\n\nYou can also create managed iam policy.\n\n```ruby\nmanaged_iam_policy(\"AmazonS3ReadOnlyAccess\")\n```\n\n## Schedule Support\n\n.cody/schedule.rb:\n\n```ruby\nrate \"1 day\"\n```\n\n## Full DSL\n\nThe convenience DSL methods shown above are short and clean.  They merely wrap a DSL that map to the properties of CloudFormation resources like [AWS::CodeBuild::Project](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html) and [AWS::IAM::Role](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html). Refer the [DSL docs](https://cody.run/docs/dsl/) for more info.\n\n## Type Option\n\nBy default, cody looks up files in the `.cody` folder.  You can affect the behavior of the Type logic with the `--Type` option.  More info [Type docs](https://cody.run/docs/type-option/).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem \"cody\"\n\nAnd then execute:\n\n    bundle\n\nOr install it yourself as:\n\n    gem install cody\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am \"Add some feature\"`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":["https://github.com/sponsors/boltops-tools"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fcody","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboltops-tools%2Fcody","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltops-tools%2Fcody/lists"}