{"id":36851553,"url":"https://github.com/akhettar/ci-templater","last_synced_at":"2026-01-12T14:37:57.625Z","repository":{"id":64302762,"uuid":"275091406","full_name":"akhettar/ci-templater","owner":"akhettar","description":"Generates Continuous integration Pipeline from a given CI Template ","archived":false,"fork":false,"pushed_at":"2021-02-15T07:33:42.000Z","size":23494,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T12:41:34.287Z","etag":null,"topics":["circleci","continuous-integration","github-actions","template-engine"],"latest_commit_sha":null,"homepage":"","language":"Go","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/akhettar.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}},"created_at":"2020-06-26T06:45:26.000Z","updated_at":"2024-06-20T12:41:34.288Z","dependencies_parsed_at":"2023-01-15T09:45:42.074Z","dependency_job_id":null,"html_url":"https://github.com/akhettar/ci-templater","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/akhettar/ci-templater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhettar%2Fci-templater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhettar%2Fci-templater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhettar%2Fci-templater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhettar%2Fci-templater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akhettar","download_url":"https://codeload.github.com/akhettar/ci-templater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhettar%2Fci-templater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["circleci","continuous-integration","github-actions","template-engine"],"created_at":"2026-01-12T14:37:57.548Z","updated_at":"2026-01-12T14:37:57.604Z","avatar_url":"https://github.com/akhettar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI Templater\n![Build](https://github.com/akhettar/ci-templater/workflows/Master/badge.svg)\n![Release](https://github.com/akhettar/ci-templater/workflows/Release/badge.svg)\n\nThis tool generate CI config for any given CI tool (Github Action, Circleci) from a given generic CI template. It ensures consistency of the CI template across all the deployments. This tool is particularly useful in the era of microservices architectural style whereby several microservices would share the same deployment pipeline. This tool allows us to generate ci config for all these services from a one given ci template. See the diagram below for the detailed flow:\n\n\n![illustaration](illustration.png)\n\n\n## Why should you use this tool?\n\nThis CI templater ensures the followings:\n\n* CI pipeline for all the deployments are generated from a `SINGLE` CI template. \n* Updates the CI pipeline for all deployments in one single run.\n* Creates Pull requests for all updated deployment pipelines.\n\n\n## Usage\n\nThis tool relies on two configuration files as input:\n\n1. Configuration file defining all the deployments with their corresponding Git repos - see [config.yml](config.yml). See a snippet below\n\n```\ndescription: Generic template to generate github action configuration files for the repositories defined in the config file\nrepositories:\n  - repo:\n      url: https://github.com/cirtak/test_repo\n      service_name: test_repo\n      key1: value1\n      key2: value2\n      ....: .....\n      keyn: valuen\n  \n```      \n\nThe above configuration file contains list of the Git repositories we aim to generate or update the CI pipeline for. The `url` is the only mandotory parameter. You can define as many parameters in the form of `key` and `value`.\n\n\n2. Template file - This file contains the CI template from which instances of the CI piepline will be generated - see [Github action sample](templates/deploy-staging.yml).\n\n\nNote that you can also define `templates` within the CI template - see [circleci pipeline example](templates/circleci-template.yml):\n\nDeclare the template as follow\n\n```\n{[define \"DEPLOYMENT\"]}\n\n\\\\ something\n\n{[end]}\n```\n\nInvoke the template for each environment as follow by passing the relevant parameters\n\n```\n{[template \"DEPLOYMENT\" map \"Env\" \"dev\" \"Name\" .service_name  \"AWSAccountNumber\" \"xxx128601811\" ]}\n{[template \"DEPLOYMENT\" map \"Env\" \"staging\" \"Name\" .service_name \"AWSAccountNumber\" \"xxx345174122\" ]}\n{[template \"DEPLOYMENT\" map \"Env\" \"prod\" \"Name\" .service_name  \"AWSAccountNumber\" \"xxx2574511\" ]}\n```\n\n## Running the tool\n\nYou can either checkout the ci-templater project or simply use the distributed binaries, see below details:\n\n### `Using the distributed binaries`\n\na. Create a folder structure as shown in the [examples/github-action](examples/github-action) \n\nb. Download the [latest release from here](https://github.com/akhettar/ci-templater/releases/) and unzip the binary in the above folder\n\nc. That is it, you are ready to go and following in the instruction below\n\nd. Update the `config.yml` with all your target git repositories and add your CI templates in the `templates` folder. Remove the existing ones as they are just samples.\n\ne. Run the tool with following command:./ci-templater\n\n### `Checkout the whole project`\n\nYou can simply checkout the whole `ci-tempalte` project and update the `config.ymml` and `templates` with the relevant CI pipeline templates. Remove the existing ones as they are there as an example. Then follow the step below:\n\n\n1. Export the following as environment variables\n\n```\nexport GITHUB_TOKEN=xxx\nexport GPG_PASSWORD=xxx - only needed if GPG signing is enabled\nexport GITHUB_EMAIL=xxx - this is the email address associated with your git account\n```\n\n\n2. Generate GPG private key if GPG signing is enabled\n\nYou can generate the private key as follow. First, extract the `GPG secret key` by running the following command: \n\n`gpg --list-secret-keys --keyid-format LONG`\n\nThe output of the above should be something similar to this:\n\n```\nsec   rsa4096/B3FBB1D34AA9E501 2020-06-18 [SC] [expires: 2022-06-18]\n      1A4945B7F183D631AB99D982B3FBB1D34AA9E501\nuid                 [ultimate] ayache@cirta.dev \u003cayache@cirta.dev\u003e\n```\n\nThe secret key should be `B3FBB1D34AA9E501`\n\n\nThen use the above secret key to generate GPG private key\n\n```\ngpg --armor --export-secret-keys ${ID} \u003e gpg-private-key \n```\n\n3. Now you can run the tool with the following command: `go build \u0026\u0026 ./ci-templater`\n\n\n### `Run the tool in dry mode`\n\nThe default set up of this tool is that it creates a pull request for each generated template. You can disable this by setting the `DryRun` flag as follow when running the tool\n\n` go build \u0026\u0026 ./ci-templater -DryRun=true`\n\n\n### `Generating the template for only one given deployment`\n\nBy default the tool will extract the deployment details from `config.yml` then uses the appropriate template for each deployment. To apply the filter for only one deployment run the tool with the `repo` flag\n\n`go build \u0026\u0026 ./ci-templater -repo=test_repo`\n\n\n## Limitations\n\nCurrently, this tool assumes the generated ci pipelines are going to be pushed to Github repository. Support for other repositories will be added in due course. Enjoy!!\n\n## LICENSE\n\n[MIT](LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhettar%2Fci-templater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhettar%2Fci-templater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhettar%2Fci-templater/lists"}