{"id":34774873,"url":"https://github.com/cloudtruth/importer","last_synced_at":"2025-12-25T08:13:53.810Z","repository":{"id":40008513,"uuid":"375827509","full_name":"cloudtruth/importer","owner":"cloudtruth","description":"An importer utility for adding parameters to cloudtruth","archived":false,"fork":false,"pushed_at":"2023-04-26T15:32:22.000Z","size":55,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-04-26T17:22:40.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudtruth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-10T20:51:43.000Z","updated_at":"2023-04-26T17:22:40.015Z","dependencies_parsed_at":"2023-02-12T07:45:13.896Z","dependency_job_id":null,"html_url":"https://github.com/cloudtruth/importer","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/cloudtruth/importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudtruth%2Fimporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudtruth%2Fimporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudtruth%2Fimporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudtruth%2Fimporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudtruth","download_url":"https://codeload.github.com/cloudtruth/importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudtruth%2Fimporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28024397,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-25T08:13:52.988Z","updated_at":"2025-12-25T08:13:53.793Z","avatar_url":"https://github.com/cloudtruth.png","language":"Ruby","readme":"[![Build Status](https://github.com/cloudtruth/importer/workflows/CD/badge.svg)](https://github.com/cloudtruth/importer/actions)\n[![Coverage Status](https://codecov.io/gh/cloudtruth/importer/branch/main/graph/badge.svg)](https://codecov.io/gh/cloudtruth/importer)\n[![Configured by CloudTruth](https://img.shields.io/badge/configured--by-CloudTruth-blue.svg?style=plastic\u0026labelColor=384047\u0026color=00A6C0\u0026link=https://cloudtruth.com)](https://cloudtruth.com)\n\n# Cloudtruth Importer\n\nAn importer utility for adding parameters to cloudtruth.\n\n## Installation\n\n```shell\ndocker pull cloudtruth/importer\n```\n\n## Uninstall\n\n```shell\ndocker rmi --force cloudtruth/importer\n```\n\n## Usage\n\nTo get the cli usage for the importer:\n\n```shell\ndocker run cloudtruth/importer --help\n```\n\nand then run it for real like: \n\n```shell\ndocker run -v $(pwd):/data -e CLOUDTRUTH_API_KEY=xyz cloudtruth/importer --dry-run /data/some/file.yaml\n```\n\nIt scans the given directories and files (or stdin), parsing those that are a\nform of structured data (json/yaml/dotenv/properties).  The structured data is\nthen passed into a transformation template in order to generate parameter\ndefinitions that are used to drive the cloudtruth cli to create the actual\nparameters.\n\nThe transformation template is processed using the [Liquid template\nlanguage](https://shopify.github.io/liquid/).  The context supplied to each\nrendering of the template will contain the variables:\n\n| Variable | Description | Type |\n|----------|-------------|------|\n| environment | The environment supplied from the `--environment` cli flag or by using a named capture from `--path-selector` (i.e. to extract the environment from filenames) | string |\n| project | The project supplied from the `--project` cli flag or by using a named capture from `--path-selector` (i.e. to extract the environment from filenames) | string |\n| filename | The filename for the data the template is currently being rendered for | string |\n| data | The structured data parsed from the file that the template is currently being rendered for | map or array depending on file contents |\n| \u003cnamed_capture\u003e | Any named captures from applying the `--path-selector` regular expression to the filename | string\n\nThe default transformation template treats the `data` passed in as a simple HashMap,\nusing its keys/value to be the parameter keys and values.  It looks like:\n\n```liquid\n{% for entry in data %}\n- environment: \"{{ environment }}\"\n  project: \"{{ project }}\"\n  key: \"{{ entry[0] }}\"\n  value: \"{{ entry[1] }}\"\n{% endfor %}\n```\n\nTo handle other data structures, your template should produce a yaml document\nthat is a list of parameter definitions of the form:\n\n```yaml\n - environment: someEnvironment,  # The environment to set the value for\n   environment_parent: someParentEnv,  # The environment's parent if using --create-environments\n   project: someProject, # The project to create the parameter in\n   project_parent: someParentProj,  # The project's parent if using --create-projects\n   key: aKey, # The key name of the parameter\n   value: aValue, # The value for the parameter.  Don't set this if using FQN+JMES\n   secret: false, # (optional) Indicate that the parameter should be created as a secret\n   fqn: myFQN, # (optional) Set the parameter value to come from the given FQN (with optional JMES) \n   jmes: myJmesPath # (optional) Set the parameter value to come from the given FQN+JMES\n```\n\n### Examples\n\n#### Read from stdin\n\n```shell\ncat somefile.yaml | docker run -i -e CLOUDTRUTH_API_KEY=xyz cloudtruth/importer --dry-run --stdin yaml\n```\n\n## Development\n\nAfter checking out the repo, run `docker build -t cloudtruth/importer .` to build the image.\n\nRun `docker run -it --entrypoint \"\" cloudtruth/importer bundle exec rspec` to run the tests.\n\nRun `docker run -it --entrypoint \"\" cloudtruth/importer bundle exec bin/console` to get an interactive console.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/cloudtruth/importer.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudtruth%2Fimporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudtruth%2Fimporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudtruth%2Fimporter/lists"}