How to use @build-tracker/build - 7 common examples

To help you get started, we’ve selected a few @build-tracker/build examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paularmstrong / build-tracker / plugins / with-postgres / src / queries.ts View on Github external
public insert = async ({ meta, artifacts }: BuildStruct): Promise => {
    const build = new Build(meta, artifacts);
    const res = await this._pool.query(
      'INSERT INTO builds (branch, revision, timestamp, parentRevision, meta, artifacts) VALUES ($1, $2, $3, $4, $5, $6)',
      [
        build.getMetaValue('branch'),
        build.getMetaValue('revision'),
        build.meta.timestamp,
        build.getMetaValue('parentRevision'),
        JSON.stringify(build.meta),
        JSON.stringify(build.artifacts)
      ]
    );

    if (res.rowCount !== 1) {
      throw new Error('Unable to insert build');
    }
github paularmstrong / build-tracker / plugins / with-mysql / src / queries.ts View on Github external
public insert = ({ meta, artifacts }: BuildStruct): Promise => {
    const build = new Build(meta, artifacts);
    return new Promise((resolve, reject) => {
      this._pool.query(
        'INSERT INTO builds (branch, revision, timestamp, parentRevision, meta, artifacts) VALUES (?, ?, ?, ?, ?, ?)',
        [
          build.getMetaValue('branch'),
          build.getMetaValue('revision'),
          build.meta.timestamp,
          build.getMetaValue('parentRevision'),
          JSON.stringify(build.meta),
          JSON.stringify(build.artifacts)
        ],
        (err, results): void => {
          if (err) {
            reject(err);
            return;
          }
github paularmstrong / build-tracker / plugins / with-mariadb / src / queries.ts View on Github external
public insert = async ({ meta, artifacts }: BuildStruct): Promise => {
    const build = new Build(meta, artifacts);
    await this._pool.query(
      'INSERT INTO builds (branch, revision, timestamp, parentRevision, meta, artifacts) VALUES (?, ?, ?, ?, ?, ?)',
      [
        build.getMetaValue('branch'),
        build.getMetaValue('revision'),
        build.meta.timestamp,
        build.getMetaValue('parentRevision'),
        JSON.stringify(build.meta),
        JSON.stringify(build.artifacts)
      ]
    );

    return Promise.resolve(build.getMetaValue('revision'));
  };
github paularmstrong / build-tracker / src / server / src / commands / seed.ts View on Github external
glob.sync(`${path.join(fixturePath, 'builds')}/*.json`).forEach(async build => {
    const buildData = require(build);
    await config.queries.build.insert(new Build(buildData.meta, buildData.artifacts));
  });
github paularmstrong / build-tracker / src / server / src / api / insert.ts View on Github external
.then(parentBuildData => {
        const parentBuild = new Build(parentBuildData.meta, parentBuildData.artifacts);
        return {
          comparator: new Comparator({
            artifactBudgets: artifactConfig.budgets,
            artifactFilters: artifactConfig.filters,
            builds: [build, parentBuild],
            groups: artifactConfig.groups
          })
        };
      })
      .then(context => {
github paularmstrong / build-tracker / src / server / src / api / insert.ts View on Github external
): RequestHandler => (req: Request, res: Response): void => {
  const { artifacts, meta } = req.body;
  const { artifacts: artifactConfig = {} } = config;
  const build = new Build(meta, artifacts);
  queries.insert(build).then(() =>
    queries
      .byRevision(build.getMetaValue('parentRevision'))
      .then(parentBuildData => {
        const parentBuild = new Build(parentBuildData.meta, parentBuildData.artifacts);
        return {
          comparator: new Comparator({
            artifactBudgets: artifactConfig.budgets,
            artifactFilters: artifactConfig.filters,
            builds: [build, parentBuild],
            groups: artifactConfig.groups
          })
        };
      })
      .then(context => {
        return onInserted(context.comparator).then(() => context);
github paularmstrong / build-tracker / src / comparator / src / index.ts View on Github external
      builds: objData.builds.map(d => Build.fromJSON(d)),
      groups: objData.groups.map(g => ({ ...g, artifactMatch: g.artifactMatch && deserializeRegExp(g.artifactMatch) }))

@build-tracker/build

Build Tracker tools for interacting with individual Builds

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis

Popular @build-tracker/build functions

Similar packages