java.lang.Object
ch.admin.bit.jeap.truststoreplugin.gitcertrepo.GitCertRepo

public class GitCertRepo extends Object
Utility class for cloning a Git repository with support for both pipeline and local environments.

This class attempts to clone a Git repository by:

  • Using the token provided as environment variable (Default `CERTIFICATES_REPO_GIT_TOKEN`) as a personal access token (PAT) for authentication when it is provided. This is typically used in CI/CD pipelines to access private GitHub repositories.
  • Falling back to the system-installed Git client when the token is not available. In this case, cloning relies on the credentials already configured in the local environment (e.g., SSH keys, credential helpers, or Git configuration).

This dual-mode approach ensures that the cloning process works seamlessly both in automated environments (such as pipelines) and in local development setups.

  • Method Details

    • of

      public static GitCertRepo of(org.apache.maven.plugin.logging.Log log, URI uri, String branch, String tokenEnvironmentPropertyName)
    • cloneTo

      public void cloneTo(File targetDirectory)