Skip to content

6543-forks/plugin-git

 
 

Repository files navigation

plugin-git

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 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) \
  --file docker/Dockerfile.linux.amd64 --tag woodpeckerci/plugin-git .

Usage

Clone a commit:

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

Clone a pull request:

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

Clone a tag:

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

Releases

No releases published

Packages

No packages published

Languages

  • Go 90.9%
  • Makefile 9.1%