tremble-ci
Tremble is a very minimalist CI utility in javascript.
Last updated 2 years ago by guilro .
AGPL-3.0 · Repository · Bugs · Original npm · Tarball
$ cnpm install tremble-ci 
SYNC missed versions from official npm registry.

tremble

Tremble is a very simple CI tool in Javascript. It provides a simple server supporting GitLab merge requests and push events.

dependencies

Table of Contents

  1. Server
    1. Supported services
      1. GitLab
  2. Library

Server

Tremble provides a CI server ready to run (preferably in Docker), that you can build in 3 steps.

  1. Create a new node project with npm init and install Tremble with npm install tremble-ci --save
  2. Create an index.js file configuring and launching the server.
  3. Create a Dockerfile and run docker.

index.js

'use strict';

const server = require('tremble-ci/server');
const path = require('path');

server({
  command: 'bash ' + path.join(__dirname, 'my_validating_script.sh'), // Required. Do not forget to put absolute path for files not in your PATH
  dataDir: path.join(__dirname, 'data'), // Required, absolute path
  pageTitle: 'My software tests' // Optional, page title for the web interface
}).listen(3000, () => {
  console.log('CI server listening on port 3000 !');
});

Dockerfile

FROM node:4-onbuild
VOLUME ["/data"]
EXPOSE 3000

Supported services

Only GitLab merge requests and push events are supported at the moment.

GitLab

/trigger/gitlab accepts GitLab merge request and push hooks. One you have installed a Tremble server, you can just register {your host}/trigger/gitlab as the hook for merge requests and push.

Use only the library

You can use just the test runner without using the server. Tremble provides both promise and callback interface. tremble() will return a promise if you do not provide a callback.

const tremble = require('tremble-ci');

tremble({
    repository: 'https://github.com/guilro/commentit', // Required
    branch: 'master', // Required
    command: 'npm test', // Required, auto cwd in the repository
    directory: './tmp/gitdirectory', // Directory where to clone the repository, defaults to a tmp/<randomNumber> in the module directory, removed after test
    timeout: 0, // Timeout for your command
    out: process.stdout // Any writable stream: the command stdout and stderr will be piped there
}, function(err, code) {
    if (err) {
     console.log(err);
    }

    console.log(code); // print the exit code
});
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (15)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |