@codefresh-io/pipeline-autobot
Generate yaml depend on repo context
Last updated 2 months ago by codefresh .
UNLICENSED · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @codefresh-io/pipeline-autobot 
SYNC missed versions from official npm registry.

Repository analyzer

About

Component for analyze github repository use github statistic API and generate codefresh steps according repo info.

Content

Usage

Examples how use repo analyzer

Run analyzer without cf integration

Run test.js with envs

PASSWORD=****2
REPO_OWNER=codefresh-io
REPO_NAME=pipeline-manager
GIT_CONTEXT=github

Run analyzer using CLI

https://codefresh-io.github.io/cli/analyzer/

Example of analyzer flow

    analyzer
        .step(clone)
        .step(build)
        .step(push)
        .step(packageJson)
        .header(stages)
        .enrich(stagesEnricher)
        .transform(codefreshYaml)
        .resolve()

Handler types that analyzer support

  1. Transformers - ability to transform from some info to whole yaml file , use cases :

    • Check that repo contain codefresh.yaml (source github context -> output codefresh yaml path)
    • Convert from gitlab to codefresh yaml (source github context -> output codefresh yaml with steps) Important : after transformer execution if we have result we terminate whole chain (not make any sense to continue)
  2. Headers - ability to add some yaml parts before steps key use cases:

    • Add codefresh yaml stages
    • Add yaml version
  3. Steps - ability to add some step to generated pipeline, like git clone, build, notifications, etc

  4. Enricher - ability to enrich each step some additional information, like stage for each step

Adding new handler

For add new handler you should create .js in related folder (like analyzer.steps)

Each step has as input analyzer.context (you can access from it githup api, credentials, everything that you need)

module.exports = (context) => {
   
       const { repo: { repoOwner, repoName, branch } , git } = context.getContext();
   
       return {
           step : {
               type: 'git-clone',
               description: 'Cloning main repository...',
               repo: `${repoOwner}/${repoName}`,
               revision: branch,
               git
           },
           key: 'clone',
           group: 'clone'
       };
   };

Where
key - it is step name
group - logical group, like test, linters, etc, will be helpful in future . (For now using it for stages)

Current Tags

  • 1.5.6                                ...           latest (2 months ago)

44 Versions

  • 1.5.6                                ...           2 months ago
  • 1.5.5                                ...           2 months ago
  • 1.5.4                                ...           2 months ago
  • 1.5.3                                ...           2 months ago
  • 1.5.2                                ...           2 months ago
  • 1.5.1                                ...           2 months ago
  • 1.5.0                                ...           4 months ago
  • 1.4.1                                ...           7 months ago
  • 1.4.0                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.4                                ...           a year ago
  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.22                                ...           a year ago
  • 1.0.21                                ...           a year ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |