Cloning

Pipeline CI/CD automatically configures a default cloning step if one has not been explicitly defined. This first step runs inside your cluster after it's created. You can manually configure this cloning step for customization in your pipeline:

+clone:
+  git:
+    image: plugins/git

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

Here's an example configuration to override depth:

clone:
  git:
    image: plugins/git
+   depth: 50

And here's an example configuration that allows you to use a custom clone plugin:

clone:
  git:
+   image: octocat/custom-git-plugin

This is an example configuration for the cloning of Mercurial repositories:

clone:
  hg:
+   image: plugins/hg
+   path: bitbucket.org/foo/bar

Git Submodules

To use the same credentials that cloned the repository to clone its submodules, update .gitmodules to use https instead of git:

[submodule "my-module"]
    path = my-module
-   url = git@github.com:octocat/my-module.git
+   url = https://github.com/octocat/my-module.git

To use an ssh git URL in .gitmodules for users cloning with ssh, and also to use a https URL in Pipeline CI/CD, add submodule_override:

clone:
  git:
    image: plugins/git
    recursive: true
+   submodule_override:
+     my-module: https://github.com/octocat/my-module.git

pipeline:
  ...