{"id":24775238,"url":"https://github.com/thisisnotjustin/autodock","last_synced_at":"2025-03-23T23:47:04.553Z","repository":{"id":274243737,"uuid":"921992949","full_name":"ThisIsNotJustin/autodock","owner":"ThisIsNotJustin","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-25T23:42:08.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T00:26:48.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThisIsNotJustin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-25T03:20:56.000Z","updated_at":"2025-01-25T23:42:11.000Z","dependencies_parsed_at":"2025-01-27T10:00:32.524Z","dependency_job_id":null,"html_url":"https://github.com/ThisIsNotJustin/autodock","commit_stats":null,"previous_names":["thisisnotjustin/autodock"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fautodock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fautodock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fautodock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsNotJustin%2Fautodock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThisIsNotJustin","download_url":"https://codeload.github.com/ThisIsNotJustin/autodock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186930,"owners_count":20574554,"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":[],"created_at":"2025-01-29T06:53:57.227Z","updated_at":"2025-03-23T23:47:04.535Z","avatar_url":"https://github.com/ThisIsNotJustin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto Dock\n\nAuto Dock is a Go based CLI tool for monitoring changes in a specified director and redeploying a container when changes are detected. It includes features such as user-defined folder watching, adjustable cooldown periods, and the ability to pause or resume auto-redeploy functionality.\n\n## Features\n\n- **Dynamic Folder Watching**: Add or remove directories to monitor at runtime.\n\n- **Auto-Redeploy**: Automatically redeploys the specified container when file changes are detected.\n\n- **Cooldown Period**: Configurable cooldown period to avoid redundant redeploys.\n\n- **Pause/Resume**: Temporarily stop and resume auto-redeploy functionality.\n\n- **Status Reporting**: View the current application state, including watched folders and cooldown settings.\n\n## Requirements\n\n- [Go](https://golang.org/dl/)\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/ThisIsNotJustin/autodock\n   ```\n3. Run the program:\n   ```bash\n   go run main.go\n   ```\n\n---\n\n## Usage\n\nWhen the program starts, it initializes with default settings. You can interact with the program using the following CLI commands:\n\n### Commands\n\n- Add a folder to watch for file changes.\n  ```bash\n  \u003e watch ./myfolder\n  ```\n- Stop watching a folder.\n  ```bash\n  \u003e watchRemove ./myfolder\n  ```\n- Display a list of all currently watched folders.\n  ```bash\n  \u003e watchList\n  ```\n- Reset watched folders list.\n  ```bash\n  \u003e reset\n  ```\n- Immediately redeploy the container.\n  ```bash\n  \u003e redeploy\n  ```\n- Pause the auto-redeploy feature.\n  ```bash\n  \u003e pause\n  ```\n- Resume the auto-redeploy feature.\n  ```bash\n  \u003e resume\n  ```\n- Set the cooldown period (e.g., `30s`, `1m`, `2h`).\n  ```bash\n  \u003e cooldown 30s\n  ```\n- Display the current state of the application.\n  ```bash\n  \u003e status\n  ```\n- Show a list of available commands.\n  ```bash\n  \u003e help\n  ```\n\n---\n\n## Example Workflow\n\n1. Start the program.\n2. Add folders to monitor:\n   ```bash\n   \u003e watch ./projects\n   \u003e watch ./config\n   ```\n3. Change a file in one of the watched folders. The program will:\n   - Detect the change.\n   - Wait for the configured cooldown period.\n   - Redeploy the container.\n4. View the application status:\n   ```bash\n   \u003e status\n   --- Current Status ---\n   Container ID: my_container\n   Auto-Redeployment: true\n   Last Change: 2025-01-26 14:31:17\n   Cooldown: 30s\n   Watched Folders:\n    - ./projects\n    - ./config\n   ```\n\n## Example Pt2\n```bash\ngo run main.go\n\u003e help\n  Available commands:\n    redeploy - Immediate deployment\n    pause - Pause auto-redeploy\n    resume - Resume auto-redeploy\n    cooldown (seconds) - Set auto-redeploy cooldown 'cooldown 60s'\n    status - See current status\n    watch (folder path) - Add folder to watch list\n    watchRemove (folder path) - Remove folder from watch list\n    watchList - Display list of folders watching for changes\n    reset - Remove all folders from watch list\n    help - This help menu\n\n\u003e status\n\n--- Current Status ---\n\nContainer ID: my_container\nAuto-Redeployment: true\nLast Change: 0001-01-01 00:00:00 +0000 UTC\nCooldown: 1m0s\n\u003e watchList\n--- Watched Folders ---\n\u003e cooldown 30s\n[!] Cooldown set to 30s\n\u003e watch ./testFolder\nWatching folder: ./testFolder\n\u003e watchList\n--- Watched Folders ---\n./testFolder\n\u003e Change in testFolder/text.txt\n[!] Change detected, starting redeployment\n[!] Redeploying Container\nRestarting container my_container\n\u003e watch ./testFolder2\nWatching folder: ./testFolder2\n\u003e watchList\n--- Watched Folders ---\n./testFolder\n./testFolder2\n\u003e Change in testFolder2/text2.txt\n[!] Change detected, starting redeployment\n[!] Redeploying Container\nRestarting container my_container\n\u003e watchList\n--- Watched Folders ---\n./testFolder\n./testFolder2\n\u003e watchRemove ./testFolder2\nRemoved ./testFolder2 from watch list\n\u003e watchList\n--- Watched Folders ---\n./testFolder\n\u003e status\n\n--- Current Status ---\n\nContainer ID: my_container\nAuto-Redeployment: true\nLast Change: 2025-01-27 22:47:14.986287 -0600 CST m=+124.997843793\nCooldown: 30s\n\u003e reset\nSuccessfully reset watched folders\n\u003e watchList\n--- Watched Folders ---\n\u003e \n```\n\n---\n\n## Acknowledgments\n\n- Inspired by the need for efficient container management during development cycles.\n- Utilizes the `fsnotify` library for file system event detection.\n\n---\n\n## Troubleshooting\n\n- **Watcher Error**: Ensure that the folder paths provided are valid and accessible.\n- **Cooldown Misconfiguration**: Use valid time formats (e.g., `30s`, `1m`).\n- **Redeployment Not Triggering**: Ensure auto-redeploy is not paused and cooldown is correctly configured.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnotjustin%2Fautodock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisisnotjustin%2Fautodock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnotjustin%2Fautodock/lists"}