{"id":28176298,"url":"https://github.com/dokuqui/job_detection","last_synced_at":"2026-04-09T21:36:07.360Z","repository":{"id":250168212,"uuid":"833670786","full_name":"Dokuqui/Job_Detection","owner":"Dokuqui","description":"Script to detect if any container, service, network, volume or date was left after job","archived":false,"fork":false,"pushed_at":"2025-02-21T15:51:17.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T16:42:59.607Z","etag":null,"topics":["docker","docker-compose","github-actions","gitlab-ci","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dokuqui.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T14:06:43.000Z","updated_at":"2025-02-21T15:51:21.000Z","dependencies_parsed_at":"2025-02-21T16:40:41.061Z","dependency_job_id":"17bfe9cb-07aa-45d9-a8f2-77603ddee384","html_url":"https://github.com/Dokuqui/Job_Detection","commit_stats":null,"previous_names":["dokuqui/job_detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dokuqui%2FJob_Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dokuqui%2FJob_Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dokuqui%2FJob_Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dokuqui%2FJob_Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dokuqui","download_url":"https://codeload.github.com/Dokuqui/Job_Detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442795,"owners_count":22071878,"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":["docker","docker-compose","github-actions","gitlab-ci","golang"],"created_at":"2025-05-16T00:17:32.101Z","updated_at":"2026-04-09T21:36:07.354Z","avatar_url":"https://github.com/Dokuqui.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Job_Detection\n\n## Overview\n\n`Job_detection` is a Go-based tool designed to manage and clean up GitLab CI and GitHub Workflows after job is finished. It monitors Docker events to detect when relevant containers start or stop and performs thorough cleanup operations to ensure no residual resources remain.\n\n## Features\n\n- Monitors Docker events for container lifecycle changes.\n- Identifies and matches containers based on configurable job patterns.\n- Stops and removes containers, networks, and volumes associated with completed GitLab CI jobs.\n- Supports Docker Compose setups by running `docker-compose down` for multi-container applications.\n- Handles graceful shutdowns to ensure cleanup is performed even when the script terminates unexpectedly.\n\n## How to Run\n\n### Prerequisites\n\n- Go 1.21 or later\n- Docker installed and running\n- GitLab Runner installed and configured\n\n### Steps\n\n1. **Clone the Repository:**\n    ```sh\n    git clone git@github.com:Dokuqui/Job_Detection.git\n    cd Job_Detection\n    ```\n\n2. **Configure Job Patterns:**\n    Create or modify the `jobPattern.json` file to specify patterns for identifying relevant containers.\n    ```json\n    {\n      \"jobPatterns\": [\n        \"^/runner-.*-project-.*-concurrent-.*-.*-build$\",\n        \"^/runner-.*-project-.*-concurrent-.*-.*-test$\",\n        \"^/runner-.*-project-.*-concurrent-.*-.*-deploy$\"\n      ]\n    }\n    ```\n\n3. **Run the Script:**\n    ```sh\n    go run github-detection.go `or` go run gitlab-detection.go\n    ```\n\n## Gitlab Configuration to run\n\nFor detailed documentation for gitlab, please visit our [Readme page](../Job_Detection/docs/gitlab-conf.md).\n\n## Tests\nAlso in each package exists dedicated test for several functions. To run them you can run in your terminal command.\n\n**Run all test:**\n```sh\ngo test -v ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokuqui%2Fjob_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdokuqui%2Fjob_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokuqui%2Fjob_detection/lists"}