Skip to content

Conversation

@ra2y
Copy link

@ra2y ra2y commented Jan 4, 2026

dis is for issue #6. if force_recreate is added as an argument in the config file, go through the list of containers and recreate them all every time there is a new commit push detected.

return result
with open("config.yml") as f:
loaded_yaml = yaml.safe_load(f)
for config in loaded_yaml.get("repos", []):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we move the load_containers somehow to this section, and add the list of containers as a field to RepoToWatch?

like if the force_recreate field is not empty, later we run the command, using the names stored in the dataclass

server.py Outdated
import time
from metrics import MetricsHandler
from typing import List
from dataclasses import field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already import dataclasses on line 2, wanna just use that and do dataclasses.field instead

@ra2y
Copy link
Author

ra2y commented Jan 6, 2026

here is how to test dis

  1. Make sure you have a config file containing the repo, branch, path, and container names. This will be the project you are watching for pushes on and want to recreate the docker container for. My config file looks like
repos:
  - name: git-workshop
    branch: cicd-testing
    path: 'C:\Users\Ray\projects\sce-stuff\git-workshop'
    containers: 
      - app
  1. Start the docker container of the other project you are tracking
  2. Run the CICD project using python server.py
  3. Make a new push to the project you are tracking
  4. There should be logs showing that a new push was detected and the docker container is being recreated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants