indra 0.0.2

Indra, continuous integration and automation tool #

Indra allows you to define continuous integration and automation scripts as Dart code. Scripts can be ran from an IDE and debugged. Indra runs as a command line tool or as a daemon with a JSON API. Indra has a user interface that interacts with the daemon.

Installation #

First, install Dart.

Then, clone Indra from GitHub:

git clone https://github.com/stijnvanbael/indra.git

Finally, install Indra:

indra/bin/install.sh

Now you can run any Indra script as

indra <script.dart> [param1=value [param2=value [...]]]

Or in case the file is named build.dart, simply

indra <[param1=value [param2=value [...]]]

Example #

Example script: reflective.dart

import 'dart:isolate';

import 'package:indra/src/cli.dart';
import 'package:indra/src/tasks/git.dart';
import 'package:indra/src/tasks/pub.dart';

main(List<String> args, SendPort outputPort) async {
  var params = setup(outputPort, args, defaultParams: {'branch': 'dev'});

  var git = new GitRepo('git@github.com:stijnvanbael/reflection.git', branch: params['branch']);
  await git.cloneOrPull();
  await Pub.get();
  await Pub.run('test/reflective.dart');
}

To run the script

indra reflective.dart

Daemon #

Indra can also be ran as a daemon:

indra-daemon <working/dir>

Any Dart file under the working directory can be scheduled to run from the daemon by calling:

POST http://localhost:8080/jobs/<name of the file excluding .dart>/schedule

You can request which jobs are running by calling:

GET http://localhost:8080/jobs

You can request the output of a job by calling:

GET http://localhost:8080/jobs/<script name>/<sequence number>/output

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  indra: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:indra/indra.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
44
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Aug 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:indra/indra.dart with components: io, isolate.

Health suggestions

Fix lib/src/tasks/git.dart. (-3.45 points)

Analysis of lib/src/tasks/git.dart reported 7 hints, including:

line 13 col 37: Use = to separate a named parameter from its default value.

line 91 col 18: Use = to separate a named parameter from its default value.

line 120 col 26: Use = to separate a named parameter from its default value.

line 128 col 65: Use = to separate a named parameter from its default value.

line 135 col 59: Use = to separate a named parameter from its default value.

Fix lib/src/tasks/jira.dart. (-1 points)

Analysis of lib/src/tasks/jira.dart reported 2 hints:

line 15 col 20: Use = to separate a named parameter from its default value.

line 16 col 16: Use = to separate a named parameter from its default value.

Fix lib/src/runner.dart. (-0.50 points)

Analysis of lib/src/runner.dart reported 1 hint:

line 12 col 1: Prefer using /// for doc comments.

Fix additional 12 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/src/task.dart (1 hint)
  • lib/src/tasks/bitbucket.dart (1 hint)
  • lib/indra.dart (Run dartfmt to format lib/indra.dart.)
  • lib/src/cli.dart (Run dartfmt to format lib/src/cli.dart.)
  • lib/src/daemon/daemon.dart (Run dartfmt to format lib/src/daemon/daemon.dart.)
  • lib/src/daemon/job.dart (Run dartfmt to format lib/src/daemon/job.dart.)
  • lib/src/daemon/script.dart (Run dartfmt to format lib/src/daemon/script.dart.)
  • lib/src/daemon/worker.dart (Run dartfmt to format lib/src/daemon/worker.dart.)
  • lib/src/daemon/worker_pool.dart (Run dartfmt to format lib/src/daemon/worker_pool.dart.)
  • lib/src/output/output.dart (Run dartfmt to format lib/src/output/output.dart.)
  • lib/src/output/text_output.dart (Run dartfmt to format lib/src/output/text_output.dart.)
  • lib/src/util/pattern_matcher.dart (Run dartfmt to format lib/src/util/pattern_matcher.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and indra.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
ansicolor ^1.0.2 1.0.2
http 0.12.0+2 0.12.0+2
meta ^1.1.6 1.1.7
shelf ^0.7.3 0.7.5
yaml ^2.1.15 2.1.16
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6