sagcc add repository assets git
Add a remote Git repository that contains user-created source assets.
Syntax
Command Central syntax:
sagcc add repository assets git name=repoName location=URL
[registryRoot=URL] [registryNamespacesRoot=URL] credentials=credAlias
[overwrite=true|false] [description=description] [branch=branch_name] [options]
Not supported by Platform Manager.
Arguments and Options
Argument or Option | Description |
name=repoName | Required. A unique name for the remote Git repository that you are adding. |
location=URL | Required. A valid URL that points to the location of the remote Git repository. For example, https://github.com/user/repo.git |
[registryRoot=URL] | Optional. A valid URL that points to the location of the registry that stores the metadata for the assets in the Git repository. The registry is located inside the local store directory. For example, if the flat file repository is located in the C:\fileRepo directory and the registry directory is "MyRegistry", you must set this parameter as follows: registryRoot=/MyRegistry |
[registryNamespacesRoot=URL] | Optional. A valid URL that points to the location of the directory that stores the registry namespaces. The namespace directory is located inside the registry directory. For example, if the registry directory is C:\fileRepo, you must set this parameter as follows: registryNamespacesRoot=/MyRegistryNs |
credentials=credAlias | Required. The alias of the COMMON-CREDENTIALS configuration instance that has the details for accessing the GIT repository. If the instance already exists, you can retrieve the alias using
sagcc list configuration instances. If the configuration instance does not exist, you must create it with the
sagcc create configuration data command. See the
Usage Notes for details about the GIT credentials input properties file that you must provide with the sagcc create configuration data command. |
[overwrite=true|false] | Optional. Use this argument when re-posting build artifacts from a Jenkins CI job. When the argument is set to true: If the repository does not exist, Command Central creates the repository. If the repository exists, Command Central removes the existing repository and creates a new one. The default is true. |
[description=description] | Optional. A description of the asset repository. |
[branch=branch_name] | Optional. The name of a branch in the git repository from which to pull assets. When you omit this argument, the command uses the branch that is set as default in the remote git repository. Note: Use a simple branch name. Do not use prefixes, such as origin/* or refs/* |
[options] | Optional. The command allows all options supported by the Command Line Interface. For a description of the options, see
Common Options. |
Usage Notes
To connect to a GIT repository using certificate authentication over SSH, you must create a COMMON-CREDENTIALS configuration instance using the
sagcc create configuration data command. Specify the following details in an input properties file when running the command:
privateKey=URL_to_private_key_file
privateKeyPassword=password_for_private_key_file
knownHosts=URL_to_file_with_known_hosts
When you want to use password authentication over HTTP, the credentials input properties file must include the username and password for the user account that can access the GIT repository, for example:
username=sag-test
password=the_password_for_sag-test_user
If you are connecting to a public GIT repository that does not require username/password to clone the repository to the local file system, you can specify the default COMMON-CREDENTIALS-NONE configuration instance as the value of the credentials argument.
When creating or updating an asset repository, you can check the progress of the operation and troubleshoot issues using
Jobmanager Jobs Commands or in the Command Central web user interface, go to Stacks > Jobs.
Examples When Executing on Command Central
To add a remote GIT repository with name "g1":
sagcc add repository assets git name=g1
location=ssh://git@github.com/sag-test/test.git credentials=gitRepoAlias
description="GIT repository hosting the asset build"
Command Central connects to the GIT repository over SSH, using the credentials defined for the credentials configuration instance with alias "gitRepoAlias":
privateKey=c:/develop-incubator/prototype-repository/build/installs/profiles/
App/workspace/github.priv
privateKeyPassword=manage
knownHosts=c:/develop-incubator/prototype-repository/build/installs/profiles/
App/workspace/known_hosts
In this example, registryRoot and registryNamespaceRoot are not included in the command and Command Central resolves them to the default values:
registryRoot="." registryNamespacesRoot="."
To add a remote GIT repository with name "g1" and pull assets from a branch with name "dev":
sagcc add repository assets git name=g1
location=ssh://git@github.com/sag-test/test.git credentials=NONE branch=dev