{"id":23011818,"url":"https://github.com/cdtrsfe/dogit","last_synced_at":"2025-08-14T06:32:15.761Z","repository":{"id":53221539,"uuid":"346289346","full_name":"CDTRSFE/dogit","owner":"CDTRSFE","description":":zap:A CLI tool to help you make a devops flow","archived":false,"fork":false,"pushed_at":"2024-03-02T07:56:09.000Z","size":69,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-18T22:12:24.196Z","etag":null,"topics":["changelog","flow","git-tag","node-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/CDTRSFE.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":"2021-03-10T08:45:11.000Z","updated_at":"2024-03-02T07:56:13.000Z","dependencies_parsed_at":"2022-09-07T14:02:03.399Z","dependency_job_id":null,"html_url":"https://github.com/CDTRSFE/dogit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDTRSFE%2Fdogit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDTRSFE%2Fdogit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDTRSFE%2Fdogit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDTRSFE%2Fdogit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CDTRSFE","download_url":"https://codeload.github.com/CDTRSFE/dogit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229805132,"owners_count":18126808,"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":["changelog","flow","git-tag","node-cli"],"created_at":"2024-12-15T10:11:18.613Z","updated_at":"2024-12-15T10:11:20.090Z","avatar_url":"https://github.com/CDTRSFE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n    \u003cimg width=\"100\" src=\"./logo.svg\"\u003e\r\n\u003c/p\u003e\r\n\r\n\u003ch1 align=\"center\"\u003edogit\u003c/h1\u003e\r\n\r\n\r\n\u003cp align=\"center\"\u003eA tool used to implement the development and release process, with freely configurable commands and plugins.\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/dogit\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/npm/v/dogit.svg\" /\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/dogit\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/npm/dt/dogit.svg\" \u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/dogit\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/npm/dm/dogit.svg\" alt=\"Downloads\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://github.com/CDTRSFE/dogit/blob/master/LICENSE\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/npm/l/dogit.svg\" alt=\"License\"\u003e\r\n    \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\nRead this in other language : English | [简体中文](./README.zh.md) \r\n\r\n#   Install\r\n\r\n```bash\r\nnpm install -g dogit\r\n```\r\n\r\n# Init\r\n\r\nIf you are using DOGIT for the first time in a project, run the following command to initialize.\r\n\r\n```bash\r\ndogit init\r\n```\r\nThen you get a configuration file called`dogit.config.js`. It looks something like this:\r\n\r\n```js\r\nmodule.exports = {\r\n    \"flow\": {\r\n        \"plugin\": \"AddTag\",\r\n        \"option\": {\r\n            \"envs\" : {\r\n                \"dev\": {\r\n                    \"prefix\": \"xjzmy-dev-v\"\r\n                },\r\n                \"test\": {\r\n                    \"prefix\": \"xjzmy-test-v\"\r\n                },\r\n                \"prod\": {\r\n                    \"prefix\": \"xjzmy-prod-v\"\r\n                }\r\n            }\r\n        },\r\n        \"hook\": {\r\n            \"before\": [\r\n                {\r\n                    \"plugin\": \"ReplaceFile\",\r\n                    \"option\": {\r\n                    \"path\": \"./build/version.js\",\r\n                    \"replace\": \"module.exports = { version: '__$tag__' }\"\r\n                    }\r\n                }\r\n            ],\r\n            \"after\": [\r\n                {\r\n                \"command\": \"npm run changelog:__$env__\"\r\n                }\r\n            ]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n\r\n# Process\r\nThen you can  begin to execute your own process with:\r\n```bash\r\ndogit flow\r\n```\r\nThis command will read the configuration file  and starts the task. As you can see from the configuration file, `flow` represents the tasks what we need to execute, and contains two types of flows\r\n\r\n- Shell scripts\r\n- Plugin\r\n\r\n\u003e Plugin processes can contain their own hook subprocesses, so they end up in a tree structure.\r\n\r\n## Shell scripts\r\n\r\nI believe everyone is familiar with shell scripts, like this:\r\n```js\r\n{\r\n  \"command\": \"command\"\r\n}\r\n```\r\n\r\n## Plugin\r\n\r\n\u003e A plugin is essentially a built-in script that has the following features over a shell\r\n- Afferent configuration\r\n- Can execute own hook\r\n- Accepts the parameters of the upper flow\r\n- Parameters can be exposed to the subordinate flow\r\n\r\n\r\nAnd in a different format than the shell\r\n\r\n```js\r\n{\r\n  \"plugin\": \"AddTag\", // Name of Plugin required\r\n  \"option\": {}, // Plugin parameters optional  \r\n  \"hook\": {}, // Hooks supported by the plugin (subflow) optional \r\n  \"when\": params =\u003e {} // Prerequisites for executing the plugin optional \r\n}\r\n```\r\nThe currently supported built-in plugins are\r\n\r\n- [AddTag](./plugin/AddTag)  Git Tag\r\n- [ReplaceFile](./plugin/ReplaceFile) Replace file contents (such as writing a new Tag version number to some files)\r\n- [GitCommit](./plugin/GitCommit) Git Commit \r\n\r\n\r\n\u003e For specific hooks and options supported by the plugin, step into the plugin directory to view the documentation\r\n\r\n`when` parameter indicates the conditions under which the current flow executes\r\n\r\n```js\r\n{\r\n    \"command\": \"npm run changelog:__$env__\",\r\n    \"when\": params =\u003e {\r\n        return params.env !== 'dev'\r\n    }\r\n}\r\n```\r\n\r\nThis means that the Changelog generation task should only be performed without the tag in dev .\r\n\r\n# i18n\r\n\r\n\r\nThe language of the tool itself can be switched with the following interactive command\r\n\r\n```bash\r\ndogit set\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdtrsfe%2Fdogit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdtrsfe%2Fdogit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdtrsfe%2Fdogit/lists"}