Managing shared configurations
The analyze-deployment-tooling repository enables you to share a configuration or deploy a configuration that has been shared with you.
The shared configurations are recommended to be stored in a source control system such as Git. When you clone the shared configurations to your machine, they are cloned to a directory outside of the analyze-deployment-tooling project and then referenced.
To use a shared configuration in your environment, you provide the file path to the directory outside of the analyze-deployment-tooling project. Then, you choose which configs or assets to link to your environment.
When you use a source control system to manage the shared configurations, use VS Code to manage the repositories that they are contained in.
Prerequisites
Before you create or use a shared configuration, you must configure the analyze-deployment-tooling repository and create the dev environment:
- Getting started with the analyze-deployment-tooling repository
- Configuration development environment
- You do not need to create a config.
Configuring your shared repositories location
Open a terminal on your host machine.
- On Windows, use a WSL terminal. Press Start -> wsl
Navigate to the
analyze-deployment-tooling/scriptsdirectory.Run the
configure-pathsscript with thesharedtask.
For example:configure-paths -t sharedBy default the script creates a folder named
my-configurationsin your home directory For example/home/<user>/my-configurations. To specify a different path, use-p <path>with your path when you run the command.Reopen the analyze-deployment-tooling folder in a dev container.
Press F1 (or Cmd+Shift+P in MacOS), typeDev Containers: Rebuild Containerand select it.
After you have run the script, you can open the shared configurations folder in VS Code. In the same terminal as step 1, navigate to your shared configuration folder and open VS Code.
For example, navigate to the directory:
cd ~/my-configurationsOpen VS Code:
code .This VS Code window is now referred to as the
shared configurations VS Code window.
Sharing a configuration
You can share a configuration that you have already developed locally, or you can start developing a shared configuration from a new template.
- From the analyze-deployment-tooling VS Code window right-click the
shared-repositorytemplate and copy it to the shared configurations VS Code window. Rename the folder to provide a name for your shared configuration.- On MacOS copy the template using the Finder app.
- You can share an existing config or asset, or create a new one to share.
- If you have local configs or assets that you want to start sharing, move the configs or assets from the analyze-deployment-tooling window into the new shared configurations window in the new
shared-repositoryfolder. - If you are creating a new config, complete the instructions in Configuration development environment to create your config. When you copy the
config-developmenttemplate, copy it to theshared-repositoryyour shared configurations VS Code window.
- If you have local configs or assets that you want to start sharing, move the configs or assets from the analyze-deployment-tooling window into the new shared configurations window in the new
- To link your shared configuration into your analyze-deployment-tooling project, complete the steps in link configurations.
Note: We recommend to share your configurations through Git and the template configuration contains the files required to work with Git. To initialize the Git repository, run git init from the terminal the shared configuration folder. For example /home/<user>/my-configurations/shared-repository. For more information about how to use Git, see Git Reference Documentation.
Linking shared configurations
Link a shared configuration to your local environment.
The configurations that can be linked must be contained within the path specified in
rootDirectory. If your configuration is located in a git repository, you can clone it to the shared configurations path.
For example,/home/<user>/my-configurations/shared-connectors.
For information on how to clone a repository in VSCode, see Setting up a repository.Update the
path-configuration.jsonfile to reference the configuration to link:Add the paths for your repositories in the
repositoriesarray. The value forpathis relative to therootDirectorypath.For example, to add the repository
/home/<user>/my-configurations/shared-connectorsthepath-configuration.jsonfile contains the following:{ "sharedConfigurations": { "rootDirectory": "/home/<user>/my-configurations", "repositories": [ { "path": "shared-connectors" } ] } }
In the terminal, run:
manage-environment -t link
Important: The repositories in the path-configuration.json are updated after you run the manage-environment -t link or the deploy commands.
Linking specific configs or assets
You can link to specific configs or assets from a shared configuration.
- Use the
configskey to specify an array of config names. Note: The backups associated with the config are also linked. - Use the
connectorskey to specify an array of connector names. - Use the
additionalResourceskey to specify a list of additional resources. - Use the
gatewaySchemaskey to specify an array of gateway schema short names. - Use the
extensionskey to specify an array of extension names. - Use the
pluginskey to specify an array of i2 Notebook plugin names. - Use the
dataSetskey to specify an array of data set names.
For example to add the following:
law-enforcementconfig and backup from theshared-configrepositoryexample-connectorandexample-connector2connectors from theshared-connectorsrepository
The path-configuration.json file contains the following:
{
"sharedConfigurations": {
"rootDirectory": "/home/<user>/my-configurations",
"repositories": [{
"path": "shared-configuration",
"configs": [
"law-enforcement"
]
},
{
"path": "shared-connectors",
"connectors": [
"example-connector",
"example-connector2"
]
}]
}
}