Skip to main content

Git Clone

The Git Clone step is used to fetch the source code repository from a Git provider, such as GitHub, GitLab, Bitbucket, or Azure DevOps, and clone it into the runner where the build and deployment processes take place. This step ensures that the latest version of the codebase is available for subsequent build and deployment steps.

Prerequisites

Before running the Git Clone step, you must complete certain prerequisites, as detailed in the table below:

Prerequisite Workflow StepDescription
Activate SSH Private KeyThis step sets up your SSH key on the build machine if you used one to connect your repository with SSH.
caution

If you have not connected your repo via SSH, the Git Clone does not have any dependency on the Activate SSH Private Key step.

Screenshot
info

We recommend using this step at the beginning of the workflow to avoid any problems in the workflow.

Input Variables

This step contains some input variable(s). It needs these variable(s) to work. The table below gives explanation for this variable(s).

Screenshot
danger

After connecting the repository, the following Reserved Environment Variables, which Git Clone uses as input, will be automatically populated. Ensure that the variable you provide has a value if you intend to make any changes. The required variables must not be left empty.

Variable NameDescriptionStatus
$AC_GIT_URLURL of the repository. After the provider connection is completed with the Git provider, these values will be set automatically.Required
$AC_GIT_COMMITCommit of the repository. This value will come from the Git provider. When a new commit is pushed, Appcircle fetches the details of the latest commit.Optional
$AC_GIT_BRANCHBranch of the repository. You can find more details about branch management. The branch information selected before starting manual build on the interface is automatically included here.Optional
$AC_GIT_TAGTag of the repository. If you have tags in your repository, Appcircle can start a build according to the tags.Optional
$AC_GIT_LFSUsed to specify whether large files will be downloaded. The default value is false.Optional
$AC_GIT_SUBMODULEUsed to specify whether the submodule should be cloned.Optional
$AC_GIT_CACHE_CREDENTIALSIf this variable is set to true, the credentials will be cached. This can be useful if the same credentials are used for multiple repositories. The default value is true.Optional
$AC_GIT_EXTRA_PARAMSIf this variable is set, it sends additional parameters for Git requests.Optional

Output Variables

The output(s) resulting from the operation of this component are as follows:

Variable NameDescription
AC_REPOSITORY_DIRSpecifies the root directory of the cloned repository. This path is automatically generated after the repository is cloned.

To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-git-clone-component


FAQ

How can I solve unexpected Operation timed out problem?

If there is a limiting upload limit on your Git provider, you will see an error like below in the Git Clone step.

error: RPC failed; curl 56 Recv failure: Operation timed out
error: 5237 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Users utilizing a self-hosted Git provider need to grant network access to use Appcircle. Access to private repositories can be achieved by whitelisting Appcircle’s IP addresses. If the upload speed of the provider is restricted, Appcircle may take longer than expected to clone the repository.

Appcircle runners have an approximate internet speed of 10 Gbps. If your Git provider imposes a maximum upload speed limit, the Git Clone step in Appcircle will be restricted by this limit and cannot exceed it. As a result, the Git Clone step may take significantly longer to complete.

For detailed information, please visit our Accessing Repositories Within Internal Networks documentation.

How can I check source of the "unexpected disconnect" error?

When repository access is granted for self-hosted Git providers, Appcircle directly attempts to clone the repository from the provider. If the upload speed limit set for your Git provider is too low, the Git Clone step will take a significantly longer time. Due to the prolonged download process, the Git provider may eventually reset the connection, resulting in an unexpected disconnection. To avoid such errors during unexpectedly long Git Clone steps, these titles can be checked.

  • Checking the upload limit defined for the Git provider.
  • If Appcircle is used through a firewall, you can check the rules set for that firewall.
  • If there is no problem with your firewall and Git provider speed limits, you can contact the security teams and check whether there is a problem in terms of security.