Woodpecker CI Plugins
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

wp-git-clone

Build Status Docker Hub Quay.io Go Report Card GitHub contributors Source: GitHub License: Apache-2.0

Woodpecker CI plugin to clone git repositories.

Usage

clone:
  git:
    image: quay.io/thegeeklab/wp-git-clone
    settings:
      depth: 50
      lfs: false

Parameters

branch optional string
Change branch name.
Default: main
commit_ref optional string
Git commit ref.
Default: refs/heads/main
commit_sha optional string
Git commit sha.
Default: $CI_COMMIT_SHA
depth optional integer
Clone depth.
Default: 0
insecure_skip_verify optional bool

Skip SSL verification.

Activating this option is insecure and should be avoided in most cases.

Default: false
lfs optional bool
Whether to retrieve LFS content if available.
Default: true
log_level optional string
Plugin log level.
Default: info
partial optional bool
Enable/disable partial clone.
Default: false
recursive optional bool
Clone submodules.
Default: true
remote optional string
Git remote HTTP clone url.
Default: $CI_REPO_CLONE_URL
remote_ssh optional string
Git remote SSH clone url.
Default: $CI_REPO_CLONE_SSH_URL
safe_directory optional string
Define/replace safe directories.
Default: $CI_WORKSPACE
ssh_key optional string
Private key for SSH clone.
Default: none
submodule_override optional generic
JSON map of submodule overrides.
Default: none
submodules_partial optional bool
Update submodules via partial clone (depth=1).
Default: true
submodules_update_remote optional bool
Update remote submodules.
Default: false
tags optional bool
Fetch git tags during clone.
Default: true
workdir optional string
Path to clone git repository.
Default: $CI_WORKSPACE

Build

Build the binary with the following command:

make build

Build the container image with the following command:

docker build --file Containerfile.multiarch --tag thegeeklab/wp-git-clone .

Test

docker run --rm \
  -e CI_REPO_CLONE_URL=https://github.com/octocat/Hello-World.git \
  -e CI_COMMIT_SHA=b3cbd5bbd7e81436d2eee04537ea2b4c0cad4cdf \
  -e CI_COMMIT_REF=refs/heads/test \
  -e CI_WORKSPACE=/tmp/wp_git_testrepo \
  -v $(pwd):/build:z \
  -w /build \
  thegeeklab/wp-git-clone