Home

Awesome

Git Resource

Tracks the commits in a git repository.

Source Configuration

Example

Resource configuration for a private repo:

resource_types:
- name: git-multibranch
  type: docker-image
  source:
    repository: cfcommunity/git-multibranch-resource

resources:
- name: source-code
  type: git-multibranch
  source:
    uri: git@github.com:concourse/git-resource.git
    branch: master
    private_key: |
      -----BEGIN RSA PRIVATE KEY-----
      MIIEowIBAAKCAQEAtCS10/f7W7lkQaSgD/mVeaSOvSF9ql4hf/zfMwfVGgHWjj+W
      <Lots more text>
      DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l
      -----END RSA PRIVATE KEY-----

Fetching a repo with only 100 commits of history:

- get: source-code
  params: {depth: 100}

Pushing local commits to the repo:

- get: some-other-repo
- put: source-code
  params: {repository: some-other-repo}

Detecting changes on all branches except master and deploy

resources:
- name: my-repo
  type: git-multibranch
  source:
    uri: git@github.com:my-org/my-repo.git
    branches: '.*'
    ignore_branches: '(master|deploy)'

Behavior

check: Check for new commits.

The repository is cloned (or pulled if already present), and any commits made after the given version are returned. If no version is given, the ref for HEAD is returned.

Any commits that contain the string [ci skip] will be ignored. This allows you to commit to your repository without triggering a new version.

in: Clone the repository, at the given ref.

Clones the repository to the destination, and locks it down to a given ref. Returns the resulting ref as the version.

Submodules are initialized and updated recursively.

Parameters

out: Push to a repository.

Push the checked-out reference to the source's URI and branch. All tags are also pushed to the source. If a fast-forward for the branch is not possible and the rebase parameter is not provided, the push will fail.

Parameters