This tool and repo is no longer used nor maintained by pivotaltracker. If anyone wishes to take over ownership and maintenance, please open an issue.
Tracks when branches (refs) are added or removed from a git repository, and returns a list of all current branches whenever any are added or removed.
Used by Concourse Branch Manager
-
uri
: Required. The location of the repository. -
private_key
: Optional. Private key to use when pulling/pushing. Example:private_key: | -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAtCS10/f7W7lkQaSgD/mVeaSOvSF9ql4hf/zfMwfVGgHWjj+W <Lots more text> DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l -----END RSA PRIVATE KEY-----
-
branch_regexp
: Optional. A regular expression selecting the branches you wish to track. By default, all branches (i.e..*
) are selected. -
max_branches
: Optional, default is 20. The maximum number of branches to track. If more than this number are selected bybranch_regexp
, an error will be returned.
Resource configuration for a private repo:
resources:
- name: git-branches
type: git-branches
branch_regexp: ".*" # This is the default
max_branches: 20 # This is the default
source:
uri: git@github.com:concourse/git-resource.git
private_key: |
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAtCS10/f7W7lkQaSgD/mVeaSOvSF9ql4hf/zfMwfVGgHWjj+W
<Lots more text>
DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l
-----END RSA PRIVATE KEY-----
The repository is cloned (or pulled if already present), if any branches
were added or deleted, or if no version is given, a single version
containing the repo uri and an array of all branches matching the
branch_regex
, up to max_branches
, is returned.
Writes the a hash containing the uri and the selected array of branches to
git-branches.json
in the destination directory.
Not implemented.
- Symlink
assets
dir to/opt/resource
, e.g.:sudo ln -s /path/to/git-branches-resource/assets /opt/resource
- Change ownership of dir to local user, e.g.
sudo chown myuser /opt/resource
test/all.sh
- Manually comment/uncomment test invocations at bottom of individual test files to run "focused" tests
- Docker Repo Page: https://hub.docker.com/r/tracker/git-branches-resource/
- Make a git tag and push
- Auth to docker:
docker login
- Make a docker tag (where "N" matches tag
0.N.0
:docker tag tracker/git-branches-resource tracker/git-branches-resource:N
- Push to docker "N" tag:
docker push tracker/git-branches-resource:N
- Push to docker "latest" tag:
docker push tracker/git-branches-resource