1.0.0-rc3 • Published 3 years ago

sentenza v1.0.0-rc3

Weekly downloads
929
License
ISC
Repository
-
Last release
3 years ago

Sentenza

Trigger build from a pipeline to another

Offers a extensible API to allow community to write/maintain adaptors for CI providers

  • travis adaptor
  • bitbucket adaptor
  • gitlab adaptor
  • circle CI adaptor

Will develop a bitbucket adaptor first

MVP Features:

CLI:

do not forget provider@version verbose

Trigger a build Triger a build and wait that build succeed/fail (using web hoks preferably, long polling if not available)

Usage:

const sentenza = new Sentenza({
  provider: 'bitbucket',
  auth: {
    username: process.env.BITBUCKET_USERNAME,
    app_password: process.env.BITBUCKET_APP_PASSWORD,
  },
});


// trigger pipeline dev at the end of dev
sentenza.trigger('dev');

// trigger custom pipeline at the end of specific branch
sentenza.on('staging').trigger({ custom: 'foo' })


// trigger custom pipeline on specific commit
sentenza.on({ commit: 'ce5b743' }).trigger({
  custom: 'foo',
  variables: {
    bar: 'baz',
  }
})

// trigger branch pipeline on specific commit
sentenza.on({ commit: 'ce5b743' }).trigger({ branch: 'dev' })


// pull request (todo)

// wait for pipeline to finish
const pipeline = await sentenza.trigger('dev');

const result = await pipeline.finished();
console.info(result);
// {status: 'failed', url: '', duration: 134 }

// wait for pipeline to suceed, throw otherwise
try {
  await pipeline.succeed();
  console.info('Pipeline suceed \\o/');
  process.exit(0);
} catch (e) {
  console.error('Pipeline failed :S');
  console.error(e);
  process.exit(1);
}
1.0.0-rc2

3 years ago

1.0.0-rc3

3 years ago

1.0.0-rc1

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.4

3 years ago

0.0.0

3 years ago