{"id":15735068,"url":"https://github.com/icanhazstring/duck-pony","last_synced_at":"2025-03-13T06:31:53.972Z","repository":{"id":43270396,"uuid":"90389076","full_name":"icanhazstring/duck-pony","owner":"icanhazstring","description":"PHP Integration Server Maintenance","archived":false,"fork":false,"pushed_at":"2023-02-27T09:16:19.000Z","size":194,"stargazers_count":5,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-26T18:57:14.043Z","etag":null,"topics":["jira","maintenance","php","server","systemctl-php","tempa-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/icanhazstring.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-05T15:14:26.000Z","updated_at":"2023-02-27T09:15:43.000Z","dependencies_parsed_at":"2024-10-25T00:15:25.503Z","dependency_job_id":"5e414dc1-1d29-4e66-90a9-3a7acd859a5b","html_url":"https://github.com/icanhazstring/duck-pony","commit_stats":{"total_commits":92,"total_committers":12,"mean_commits":7.666666666666667,"dds":0.5,"last_synced_commit":"39dc6328f3f0585936d09a3f6c9e5b792eb0af01"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fduck-pony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fduck-pony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fduck-pony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fduck-pony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icanhazstring","download_url":"https://codeload.github.com/icanhazstring/duck-pony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243357648,"owners_count":20277988,"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":["jira","maintenance","php","server","systemctl-php","tempa-php"],"created_at":"2024-10-04T01:08:32.887Z","updated_at":"2025-03-13T06:31:53.564Z","avatar_url":"https://github.com/icanhazstring.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# duck-pony\n\n`duck-pony` is a little maintenance tool used to manage integration server instances.\nIt is linked to Atlassian Jira to retrieve information of what actions to perform.\n\nThese actions include\n- CleanBranch\n- CleanMySQLDatabase\n- PurgeService\n- RemoveOrphanedSymlinks\n\n# Installation\nTo use this tool simply clone or download it onto your integration server.\n\u003e Be aware that some commands needs some kind of `root` execution rights (e.g. to shutdown a service using `systemctl`)\n\nStart by using composer to install all needed packages. (You might want to skip dev packages)\n```bash\n$ composer install --no-dev\n```\n\nTo configure your `config.yml` use [icanhazstring/tempa-php](https://github.com/icanhazstring/tempa-php) which is included in this tool.\n\n```bash\n$ vendor/bin/tempa file:substitute \\\n    config/ \\\n    tempa.json \\\n    jira_host=JIRA_HOST \\\n    jira_username=JIRA_USER \\\n    jira_password=JIRA_PASSWORD \\\n    pattern=BRANCH_PATTERN_REGEX \\\n    db_host=DB_HOST \\\n    db_username=DB_USER \\\n    db_password=DB_PASSWORD \\\n    instance_pattern=SYSTEMD_SERVICE_PATTERN \\\n    slack_token=SLACK_TOKEN \\\n    slack_channel=SLACK_CHANNEL\n\n```\n\n\u003e The `pattern` is used to identify tickets and folders alike. This means, your folders **MUST** have the same name\nas the ticket in your jira board.\n\n\u003e If slack_token and slack_channel are set, logged messages with a level of critical or higher will be sent to this slack channel\n\n# Commands\n## CleanBranch\n\n```bash\n$ bin/dp folder:clean --help\n\nDescription:\n  Scan folder an clean branches\n\nUsage:\n  folder:clean [options] [--] \u003cfolder\u003e\n\nArguments:\n  folder                 Folder\n  branchname-filter      Remove parts of the folder name to match jira ticket\n\nOptions:\n  -s, --status=STATUS          Status\n  -p, --pattern=PATTERN        Branch pattern\n      --keep-days[=KEEP-DAYS]  The number of days a branch is allowed to remain.\n  -i, --invert                 Invert status\n  -y, --yes                    Confirm questions with yes\n  -c, --config=CONFIG          Config [default: \"/home/vendor/duck-pony/config/config.yml\"]\n  -f, --force                  Force delete\n  -h, --help                   Display this help message\n  -q, --quiet                  Do not output any message\n  -V, --version                Display this application version\n      --ansi                   Force ANSI output\n      --no-ansi                Disable ANSI output\n  -n, --no-interaction         Do not ask any interactive question\n  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n  --branchname-filter          Remove parts of the branchname for better jira ticket matching\n\nHelp:\n  Scan folder iterate over sub folders and removes\n  them under certain conditions\n```\n\n**Example**: Clean every branch that is currently **not** \"in progress\", \"reopened\", \"todo\" or \"in review\".\n```bash\n$ bin/dp folder:clean /path/to/folder --status=\"reopened,open,in progress,in review\" --invert --yes\n```\n\n## PurgeService\n\n```bash\nDescription:\n  Scan folder an purge services with same name\n\nUsage:\n  service:purge [options] [--] \u003cfolder\u003e\n\nArguments:\n  folder                 Deployment folder as reference\n\nOptions:\n  -u, --unit=UNIT        Name of unit\n  -p, --pattern=PATTERN  Instance pattern\n  -h, --help             Display this help message\n  -q, --quiet            Do not output any message\n  -V, --version          Display this application version\n      --ansi             Force ANSI output\n      --no-ansi          Disable ANSI output\n  -n, --no-interaction   Do not ask any interactive question\n  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  Disables and stops systemd services that have\n  no reference folder in given folder argument\n```\n\n**Example**: Purge every `awesome` service from systemd which is not present in scanned folder\nAssuming the following folder structure and services:\n```\n/path/to/folder\n |- ABC-123\n\n\nsystemd services:\n- awesome@ABC-124\n- awesome@ABC-125\n```\n\nExecuting this command:\n```bash\n$ bin/dp service:purge /path/to/folder --unit=awesome@'\n```\n\nWill remove the following systemd services:\n- awesome@ABC-124\n- awesome@ABC-125\n\n## RemoveOrphanedSymlinks\n\n```bash\nDescription:\n  Removes orphaned symlinks of a given folder\n\nUsage:\n  symlinks:remove_orphaned \u003cfolder\u003e\n\nArguments:\n  folder                Folder\n\nOptions:\n  -h, --help            Display this help message\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  Removes only orphaned symlinks under a given folder without any recursion.\n```\n\nExample: Remove every orphaned symlink under nginx site-enabled\n```bash\n$ bin/dp symlinks:remove_orphaned /etc/nginx/sites-enabled\n```\n\n## CleanMySQLDatabase\n```bash\n$ bin/dp db:clean --help\n\nDescription:\n  Scans Database and cleans orphaned\n\nUsage:\n  db:clean [options] [--] \u003cpattern\u003e\n\nArguments:\n  branchname-filter      Remove parts of the folder name to match jira ticket\n\nOptions:\n  -s, --status=STATUS    Status\n  -p, --pattern=PATTERN  Branch pattern\n  -i, --invert           Invert status\n  -h, --help             Display this help message\n  -q, --quiet            Do not output any message\n  -V, --version          Display this application version\n      --ansi             Force ANSI output\n      --no-ansi          Disable ANSI output\n  -n, --no-interaction   Do not ask any interactive question\n  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  Scans MySQL Databases and removes\n  them under certain conditions\n```\n\n**Example**: Clean every database of tickets that are currently **not** \"in progress\", \"reopened\", \"todo\" or \"in review\".\n```bash\n$ bin/dp db:clean --status=\"reopened,open,in progress,in review\" --invert rsv_feature- rsv_bugfix-\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fduck-pony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficanhazstring%2Fduck-pony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fduck-pony/lists"}