Configuring sources
If you are managing multiple control repos with Code Manager, you must use the sources
parameter to specify a map
of your source repositories.
The sources
parameter is necessary when Code Manager is managing multiple control
repos. For example, your Puppet environments
are in one control repo and your Hiera data is
in a separate control repo.
The sources
setting and the
repositories
setting (under git_settings
) must match.
If sources
is set, you can't use Code Manager's global
remote
parameter.
The sources
parameter consists of a list of source names along with a
hash containing the remote
and prefix
key for each source. For
example:
myorg: remote: "git://git-server.site/myorg/main-modules" prefix: true mysource: remote: "git://git-server.site/mysource/main-modules" prefix: "testing"
The remote
parameter specifies the location from which to
fetch the source repo. Code Manager must be
able to fetch the remote without any interactive input. This means fetching the source
can't require inputting a user name or password. You must supply a valid URL, as a
string, that Code Manager can use to clone the
repo, such as: "git://git-server.site/myorg/main-modules"
The prefix
parameter specifies a string to use as a
prefix for the names of environments derived from the specified source. Set this to a
specific string if you want to use a specific prefix, such as "testing"
. Set this to true
to use the
source's name as the prefix. The prefix
parameter
prevents collisions (and confusion) when multiple sources with identical branch names
are deployed into the same directory.
For example, the following settings might cause errors or confusion because there would
be two main-modules
environments deployed to the same
base directory:
myorg: remote: "git://git-server.site/myorg/main-modules" prefix: true mysource: remote: "git://git-server.site/mysource/main-modules" prefix: true
However, by changing one prefix
to "testing"
, the two environments become more distinct, since the directory
would now have a main-modules
environment and a testing-main-modules
environment:
myorg: remote: "git://git-server.site/myorg/main-modules" prefix: true mysource: remote: "git://git-server.site/mysource/main-modules" prefix: "testing"