Skip to content
프로젝트

소개

Woodpecker plugin for cloning Git repositories

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

plugin-git

Build Status Discord chat GoDoc Docker pulls License: Apache-2.0

Woodpecker plugin to clone git repositories. For the usage information and a listing of the available options please take a look at the docs. The docs are also available in docs.md in this repository.

Build

Build the binary with the following command:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

go build -v -a -tags netgo -o release/linux/amd64/plugin-git

Docker

Build the Docker image with the following command:

docker buildx build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --platform linux/amd64 --output type=docker \
  --file docker/Dockerfile.multiarch --tag woodpeckerci/plugin-git .

The platform linux/amd64 should be replaced by the correct platform.

This will build the image and load it into docker so the image can be used locally. More information on the output formats can be found in docker buildx doc.

Podman on FreeBSD

In order to be able to use podman on FreeBSD to build the image, you'll need to install the podman-suite package and your FreeBSD version must be 14.2 or higher.

To build the image on FreeBSD, use this podman command as root:

podman build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --platform freebsd/amd64  --file docker/Dockerfile.freebsd \
  --tag woodpeckerci/plugin-git --network host  .

The image can then be pushed with podman push etc.

Usage

Clone a commit:

docker run --rm \
  -e CI_REPO_CLONE_URL=https://github.com/garyburd/redigo.git \
  -e CI_WORKSPACE=/go/src/github.com/garyburd/redigo \
  -e CI_PIPELINE_EVENT=push \
  -e CI_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
  -e PLUGIN_REF=refs/heads/master \
  woodpeckerci/plugin-git

Clone a pull request:

docker run --rm \
  -e CI_REPO_CLONE_URL=https://github.com/garyburd/redigo.git \
  -e CI_WORKSPACE=/go/src/github.com/garyburd/redigo \
  -e CI_PIPELINE_EVENT=pull_request \
  -e CI_COMMIT_SHA=3b4642018d177bf5fecc5907e7f341a2b5c12b8a \
  -e PLUGIN_REF=refs/pull/74/head \
  woodpeckerci/plugin-git

Clone a pull request and attempt merging it with the target branch:

docker run --rm \
  -e CI_PIPELINE_EVENT=pull_request \
  -e CI_REPO_CLONE_URL=https://codeberg.org/johanvdw/test-git-plugin.git \
  -e CI_COMMIT_SHA=d02eaf69b920b19fd7b14ad3aee622dd97413fbc \
  -e CI_COMMIT_TARGET_BRANCH=main \
  -e PLUGIN_REF=refs/pull/1/head \
  -e PLUGIN_MERGE_PULL_REQUEST=true \
  -e PLUGIN_GIT_USERNAME=ci \
  -e [email protected] \
   release/plugin-git

Clone a tag:

docker run --rm \
  -e CI_REPO_CLONE_URL=https://github.com/garyburd/redigo.git \
  -e CI_WORKSPACE=/go/src/github.com/garyburd/redigo \
  -e CI_PIPELINE_EVENT=tag \
  -e CI_COMMIT_SHA=3b4642018d177bf5fecc5907e7f341a2b5c12b8a \
  -e PLUGIN_REF=refs/tags/74/head \
  woodpeckerci/plugin-git

Build arguments

HOME

The docker image can be build using --build-arg HOME=<custom home>. This will create the directory for the custom home and set the custom home as the default value for the home plugin setting (see the plugin docs for more information about this setting).

관련 프로젝트 살펴보기

불러오는 중…