Skip to content

thepetk/alizer-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alizer

Go Build status License

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

  • Programming languages.
  • Frameworks.
  • Tools used to build the application.

Additionaly, Alizer can also select one devfile (cloud workspace file) from a list of available devfiles and/or detect components (the concept of component is taken from Odo and its definition can be read on odo.dev).

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/devfile/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:

  • Name: name of the component
  • Path: root of the component
  • Languages: list of languages belonging to the component ordered by their relevance.
  • Ports: list of ports used by the component
import "github.com/devfile/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/devfile/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.

  • The title of the release has to be the new version. Alizer follows the {major}.{minor}.{bugfix} format (e.g 0.1.0)
  • The description of the release is optional. You may add a description if there were outstanding updates in the project, not mentioned in the issues or PRs of this release.

Feedback & Questions

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published