Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryu1kn/buildmate
Given a list of file paths, invokes all build tasks that match any of the path patterns.
https://github.com/ryu1kn/buildmate
build-tool npm-package
Last synced: about 1 month ago
JSON representation
Given a list of file paths, invokes all build tasks that match any of the path patterns.
- Host: GitHub
- URL: https://github.com/ryu1kn/buildmate
- Owner: ryu1kn
- Created: 2017-08-04T11:33:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-11T18:22:03.000Z (2 months ago)
- Last Synced: 2024-10-09T18:32:00.618Z (about 1 month ago)
- Topics: build-tool, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/buildmate
- Size: 844 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/ryu1kn/buildmate.svg?branch=master)](https://travis-ci.org/ryu1kn/buildmate)
[![Coverage Status](https://coveralls.io/repos/github/ryu1kn/buildmate/badge.svg?branch=master)](https://coveralls.io/github/ryu1kn/buildmate?branch=master)# Build Mate
Build Mate. Given a list of file paths, invokes all build tasks that match any of the paths.
## Prerequisite
* Node.js v6+
## Usage
```sh
# Make your CI service to install Build Mate
$ npm install -g buildmate# Pipe git diff output to Build Mate
$ git diff --name-only COMMIT1...COMMIT2 | buildmate
```* `buildmate.config.js`
```js
module.exports = {
tasks: [
// Failure of the notification doesn't abort the whole build
{
description: 'Notify build start',
command: './notify-build-start.sh',
continueOnFailure: true
},// Regex path pattern.
// Capturing parts of path with `()` and reference them in the command with BM_PATH_VAR_X env variables
{
path: /^(modules\/[^/]+)\//,
command: 'cd $BM_PATH_VAR_1 && npm run build'
},// Glob path pattern
{
path: 'lib/**',
command: './build.sh lib'
}
]
}
```If `COMMIT1...COMMIT2` includes changes in the following files:
```
modules/module-A/src/index.js
modules/module-B/test/lib/bootstrap.js
```Build Mate invokes following 3 commands in the order
```sh
./notify-build-start.sh
# Failure of this task command doesn't abort the buildcd modules/module-A && npm run build
# $BM_PATH_VAR_1 is expanded to modules/module-Acd modules/module-B && npm run build
# $BM_PATH_VAR_1 is expanded to modules/module-B
```### Task properties
#### `path`
Optional. Path pattern to decide if task should be executed (and capture path vars).
`path` can be an regular expression or glob. Omitting `path` will always execute the task.#### `description`
Optional. Task description printed out at the beginning of task execution.
#### `command`
Required. Command to execute. Path variables captured in `path` matching phase can be referenced
as environment variables like `BM_PATH_VAR_N` where `N` is a sequential number starts from 1.#### `continueOnFailure`
Optional. Specify `true` if you want to continue the build on the task failure.