DevSpace allows you to define dependencies between several software projects that have a
devspace.yaml, e.g. across different git repositories. This makes DevSpace a great tool for building and deploying software that consists of several microservices.
Dependencies for DevSpace projects are defined within the
dependencies section of
- Git Repository
- Local Path
DevSpace is able to work with dependencies from the following sources:
gitrepository as dependency that has a devspace configuration (recommended)
pathto a local folder]](/cli/docs/configuration/dependencies/git-repository) that contains a dependency (path is relative to the current project's root directory)
git as dependency source is recommended because it makes it much easier to share the configuration with other developers on your team without forcing everyone to check out the dependencies and to place them in the same folder structure.
When a DevSpace project has dependencies, DevSpace will:
- Resolve all dependencies in a recursive manner
- Build a non-cyclic dependency tree
- Choose a leave node from the dependency tree, build its images (unless skip is defined) and deploy its deployments
- Remove the leave node from the tree and repeat step 3 until everything has been deployed
The algorithm used by DevSpace for building and deploying dependencies ensures that all dependencies have been deployed in the correct order before the project you are calling DevSpace from will be built and deployed.
If DevSpace detects that two projects within the dependency tree define the same child-dependency (i.e. a redundant dependency), DevSpace will try to resolve this by removing the denepdency that is "higher" (i.e. found first when resolving dependencies) within the tree.
If DevSpace detects two projects which define each other as dependencies (either directly or via child-dependencies), DevSpace will terminate with an error showing the problematic dependency path within the dependency tree.
To resolve circular dependencies, DevSpace allows you to ignore dependencies of dependencies by setting
ignoreDependencies: true for a dependency.
devspace update dependencies
If you want to force DevSpace to update the dependencies (e.g. git fetch & pull), you can run the following command: