https://github.com/automattic/git-s3-cache-buildkite-plugin
Adds a pre-checkout hook that downloads a git mirror from S3 and uses it as part of the checkout process.
https://github.com/automattic/git-s3-cache-buildkite-plugin
buildkite-plugin
Last synced: 3 months ago
JSON representation
Adds a pre-checkout hook that downloads a git mirror from S3 and uses it as part of the checkout process.
- Host: GitHub
- URL: https://github.com/automattic/git-s3-cache-buildkite-plugin
- Owner: Automattic
- Created: 2021-06-28T17:01:50.000Z (over 4 years ago)
- Default Branch: trunk
- Last Pushed: 2023-11-24T11:26:47.000Z (almost 2 years ago)
- Last Synced: 2025-01-30T01:12:33.530Z (8 months ago)
- Topics: buildkite-plugin
- Language: Shell
- Homepage:
- Size: 29.3 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git S3 Cache Buildkite Plugin
Adds a `pre-checkout` hook that downloads a git mirror from S3 and uses it as part of the `checkout` process.
## Example
Add the following to your `pipeline.yml`:
```yml
steps:
- command:
- "yarn install"
- "yarn run test"
plugins:
- automattic/git-s3-cache#v1.0.0:
bucket: "my-s3-bucket"
repo: "path-to-repo-in-s3/"
```## Configuration
Before using this plugin, you should have an S3 bucket set up in a format similar to:
```
my-bucket/
├── my-project/
│ ├── 2020-01-01-my-project.git
│ ├── 2020-01-03-my-project.git
│ ├── 2020-01-05-my-project.git
```Or:
```
my-bucket/
├── my-project/
│ ├── 2000-01-01
│ ├── my-project.git
│ └── 2001-01-02
│ ├── my-project.git```
Git mirrors must end in `.git`, and should be sorted alphabetically with the most recent mirror appearing last.
### `bucket` (Required, string)
The S3 bucket containing your mirrors.
### `repo` (Required, string)
The S3 path to the repo. For example `my-org/my-project`.
## Developing
To run the tests:
```shell
docker-compose run --rm lint
```## Contributing
1. Fork the repo
2. Make the changes
3. Run the tests
4. Commit and push your changes
5. Send a pull request