redhat-developer / alizer

⛔️ DEPRECATED - Application analyzer toolkit, use https://github.com/devfile/alizer instead
Apache License 2.0
12 stars 17 forks source link

Alizer

Alizer (which stands for Application Analyzer) is a utilily whose goal is to extract informations about an application source code.

🚨 DEPRECATION WARNING

This repository is deprecated and will be archived. Active developement of this tool has been moved to devfile/alizer.

Usage

CLI

The Go CLI can be built with the below command:

# inside the go/ dir
$ go build alizer.go

CLI Arguments

alizer analyze

./alizer analyze [OPTION]... [PATH]...
  --log {debug|info|warning}    sets the logging level of the CLI. The arg accepts only 3 values [`debug`, `info`, `warning`]. The default value is `warning` and the logging level is `ErrorLevel`.

alizer component

./alizer component [OPTION]... [PATH]...
  --port-detection {docker|compose|source}    port detection strategy to use when detecting a port. Currently supported strategies are 'docker', 'compose' and 'source'. You can pass more strategies at the same time. They will be executed in order. By default Alizer will execute docker, compose and source.

alizer devfile

./alizer devfile [OPTION]... [PATH]...
  --registry strings    registry where to download the devfiles. Default value: https://registry.devfile.io

Library Package

Language Detection

To analyze your source code with Alizer, just import it and use the recognizer:

import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

languages, err := recognizer.Analyze("your/project/path")

Component Detection

It detects all components which are found in the source tree where each component consists of:

import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

components, err := recognizer.DetectComponents("your/project/path")

For more info about name detection, see the name detection doc.

For more info about port detection, see the port detection doc.

Devfile Detection

It selects a devfile from a list of devfiles (from a devfile registry or other storage) based on the information found in the source tree.

import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

devfile, err := recognizer.SelectDevFileFromTypes("your/project/path", devfiles)

Outputs

Example of analyze command:

[
  {
    "Name": "Go",
    "Aliases": ["golang"],
    "Weight": 94.72,
    "Frameworks": [],
    "Tools": ["1.18"],
    "CanBeComponent": true
  }
]

Example of component command:

[
  {
    "Name": "spring4mvc-jpa",
    "Path": "path-of-the-component",
    "Languages": [
      {
        "Name": "Java",
        "Aliases": null,
        "Weight": 100,
        "Frameworks": ["Spring"],
        "Tools": ["Maven"],
        "CanBeComponent": true
      }
    ],
    "Ports": null
  }
]

Example of devfile command:

[
  {
    "Name": "nodejs",
    "Language": "JavaScript",
    "ProjectType": "Node.js",
    "Tags": ["Node.js", "Express", "ubi8"]
  }
]

Contributing

This is an open source project open to anyone. This project welcomes contributions and suggestions!

For information on getting started, refer to the CONTRIBUTING instructions.

Release process

The release process of alizer is very straightforward. You can create a new release here.

Release Binaries

For each release a group of binary files is generated. More detailed we have the following types:

In order to download a binary file:

Feedback & Questions

If you discover an issue please file a bug and we will fix it as soon as possible.