-
-
Notifications
You must be signed in to change notification settings - Fork 5
Hooks
Hooks can be created and run in Ouroboros v1.6.0+
To create a hook, make a directory inside of the /app/pyouroboros/hooks
directory of the Ouroboros volume with the name of the hook, then create one or more python files with the extension .py
For Example: /app/pyouroboros/hooks/before_self_cleanup/mytask.py
Runs when Ouroboros is in Container mode, after a self-update has occurred, but before the old Ouroboros container is removed
Locals:
- old_container - An instance of Docker.Container representing the old Ouroboros container
- new_container - An instance of Docker.Container representing the new Ouroboros container
Runs when Ouroboros is in Container mode, after a self-update has occurred, and after the old Ouroboros container is removed
Locals:
- old_container - An instance of Docker.Container representing the old Ouroboros container
- new_container - An instance of Docker.Container representing the new Ouroboros container
Runs when Ouroboros is in Container mode, before a self-update occurs, but before the new Ouroboros container is created
Locals:
- self_name - The name that the new container will take on
- old_container - An instance of Docker.Container representing the old Ouroboros container
- new_image - An instance of Docker.Image representing the image that the new container will run
Runs when Ouroboros is in Container mode, after a self-update occurs
Locals:
- self_name - The name that the new container is using
- old_container - An instance of Docker.Container representing the old Ouroboros container
- new_image - An instance of Docker.Image representing the image that the new container is running
- new_container - An instance of Docker.Container representing the new Ouroboros container
Runs before a container that was marked via com.ouroboros.depends_on or com.ouroboros.hard_depends_on is stopped
Locals:
- container - An instance of Docker.Container representing the container being stopped
Runs before a container that was marked via com.ouroboros.depends_on is started
Locals:
- container - An instance of Docker.Container representing the container being started
Runs before a container that was marked via com.ouroboros.hard_depends_on is recreated
Locals:
- old_container - An instance of Docker.Container representing the old container
Runs after a container that was marked via com.ouroboros.hard_depends_on is recreated
Locals:
- old_container - An instance of Docker.Container representing the old container
- new_container - An instance of Docker.Container representing the new container
Runs when Ouroboros is in Container mode, before an update occurs, but before the new container is created
Locals:
- old_container - An instance of Docker.Container representing the old container
- old_image - An instance of Docker.Image representing the outdated image that the old container is running
- new_image - An instance of Docker.Image representing the image that the new container will run
Runs when Ouroboros is in Container mode, after an update occurs
Locals:
- old_container - An instance of Docker.Container representing the old container
- old_image - An instance of Docker.Image representing the outdated image that the old container is running
- new_image - An instance of Docker.Image representing the image that the new container will run
- new_container - An instance of Docker.Container representing the new container
Runs when Ouroboros is in Container mode, after the update list has been enumerated
Locals:
-
updateable - A List of entries
(container, current_image, latest_image)
containing the Docker.Container representing the current (outdated) container, and Docker.Image representing the current (outdated) image and the latest image, respectively - depends_on_containers - A List of Docker.Container representing dependency containers that will be stopped before the updates occur, then started again after the updates conclude
- hard_depends_on_containers - A List of Docker.Container representing hard dependency containers that will be stopped before the updates occur, then recreated (without updating) after the updates conclude
Runs when Ouroboros is in Container mode with dry-run mode enabled, for each container that would of been updated
Locals:
- container - An instance of Docker.Container representing the current (outdated) container
- current_image - An instance of Docker.Image representing the outdated image that the container is running
- latest_image - An instance of Docker.Image representing the new image that the container can be updated to
Runs when Ouroboros is in Container mode with monitor-only mode enabled, for each container that needs an update
Locals:
- container - An instance of Docker.Container representing the current (outdated) container
- current_image - An instance of Docker.Image representing the outdated image that the container is running
- latest_image - An instance of Docker.Image representing the new image that the container can be updated to
Runs when Ouroboros is in Container mode with the Cleanup option, after an update has occurred, but before the outdated image is removed
Locals:
- image - An instance of Docker.Image representing the outdated image that is about to be removed