relativeCI

Specialized insights for web bundles

Configure @relative-ci/agent CLI

1. Output webpack stats

@relative-ci/agent uses the JSON output of Webpack stats as a source of data. The following webpack.stats options are needed:

// webpack.config.js
{
  stats: {
    context: './src', // optional, will improve readability of the paths
    assets: true,
    entrypoints: true,
    chunks: true,
    modules: true
  }
}

Select the method to output the webpack stats JSON file:

2. Configure @relative-ci/agent

// relativeci.config.js
module.exports = {
  // Allow the agent to pick up the current commit message
  includeCommitMessage: true,
  webpack: {
    // Path to Webpack stats JSON file
    stats: './dist/webpack-stats.json'
  }
};

3. Configure Continuous Integration(CI) service

1. Add environment variables

RELATIVE_CI_KEY

(Requiered) Navigate to https://app.relative-ci.com and copy the project specific key from Project -> Settings -> Keys.

RELATIVE_CI_SLUG

(Requiered for unsupported CI services) Set your Github project slug (eg: webpack/webpack.js.org) if your CI service is not supported (https://github.com/pvdlg/env-ci#supported-ci).

2. Run @relative/ci-agent on CI

Add a CI job to run @relative-ci/agent after the build job.

View config examples for:



Debugging

You can inspect the values for your setup using DEBUG environment variable:

$ DEBUG=relative-ci:agent npx relative-ci-agent
relative-ci:agent Config {
  config: {
    includeCommitMessage: true,
    webpack: { stats: './artifacts/webpack.json' }
  },
  filepath: '/repo/relativeci.config.js'
} +0ms
relative-ci:agent env-ci params {
  branch: 'master',
  build: 122,
  buildUrl: '#',
  commit: '2e201aa',
  isCi: true,
  pr: undefined,
  prBranch: undefined,
  slug: 'organization/project'
} +111ms

Need help?Contact us via Email, Twitter, or Github!