Coder Social home page Coder Social logo

ryu1kn / buildmate Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 864 KB

Given a list of file paths, invokes all build tasks that match any of the path patterns.

Home Page: https://www.npmjs.com/package/buildmate

JavaScript 98.96% Shell 1.04%
build-tool npm-package

buildmate's Introduction

Build Status Coverage Status

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

# 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
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

./notify-build-start.sh
# Failure of this task command doesn't abort the build

cd modules/module-A && npm run build
# $BM_PATH_VAR_1 is expanded to modules/module-A

cd 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.

buildmate's People

Contributors

dependabot[bot] avatar ryu1kn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.