How to Create Projects in Bulk
  • 21 Mar 2022
  • 3 Minutes to read
  • Dark
    Light
  • PDF

How to Create Projects in Bulk

  • Dark
    Light
  • PDF

Article Summary

While projects can be created or updated one at a time through the console, this may not always be practical to perform these actions for many projects. In these cases, it is possible to add multiple projects using a single file. Ion Channel supports creating projects via a CSV or SPDX file using the Ion Connect CLI.


CSV Import Files

Import Template Creation

This file can help get you started with creating an import file in the required CSV format. It contains all of the headers that may be included. Brief details of each of the fields can be found below. For more detailed information regarding each of the fields, see the Project Creation documentation.

Required Fields

Each of these headers and the data in these fields is required.

  • type - The type of project. Valid values are git, svn, artifact, and source_unavailable. Importing S3 projects is not currently supported.
  • url - The source of the repository or artifact. Not required if the project type is source_unavailable.
  • branch - The branch of a Git project. Only used if the project type is git.
  • name - The name of the project as it should appear within Ion Channel.
  • vendor - The organization that created the software. These fields may be left blank, but the header must be present.
  • product - The name of the product. These fields may be left blank, but the header must be present.
  • version - The version of the product. These fields may be left blank, but the header must be present.

Optional Fields

These headers are optional, and the fields may be left blank when the headers are present.

  • ruleset_id - The ID of the ruleset that you would like to be applied to the project. The default ruleset will be applied if no ruleset ID is provided. See Rules and Rulesets for information on obtaining a ruleset ID.
  • poc_name - The name of the point of contact for this project.
  • poc_email - The email address of the point of contact for this project.
  • description - Descriptive information about the project. If any commas are in the description, the entire description needs to be enclosed in double quotation marks.
  • active - Whether the project is active (not archived) or not. Valid values are either true or false. If no value is provided, the project will default to active status.
  • monitor - Whether the project is analyzed automatically once every day. Valid values are either true or false. If no value is provided, the project will default to being monitored.

Importing a CSV via Ion Connect

Once you have Ion Connect installed, the following command can be used to import a CSV file's projects. Just fill in the CSV file's path.

ion-connect project create-projects-csv -t <team-id> <filepath>

SPDX Files

Ion Channel can create projects using the data contained in an SPDX file. The following mapping is used for a project's data.

  • PackageName: - Project Name and Product Name
  • PackageSupplier: Organization: - Organization Name
  • PackageSupplier: Person:- Organization Name if PackageSupplier: Organization not provided.
  • PackageOriginator: - Organization Name if neither PackageSupplier fields above are provided.
  • PackageVersion: - Version
  • PackageDownloadLocation: - Project Source

The type of project that will be created is determined by the value provided for PackageDownloadLocation. Git projects will have the branch set as the default branch (HEAD).

Importing an SPDX via Ion Connect

Once you have Ion Connect installed, the following command can be used to import an SPDX file's projects. See below for a description of all flags.

ion-connect project create-projects-spdx --ruleset-id <ruleset-id> --spdx-version <spdx-version> --team-id <team-id>

Flags:

  • ruleset-id - The ID of the ruleset that you want to be applied to all of the projects.
  • spdx-version - The version of the SPDX file. Valid values are 2.1 or 2.2. If not provided, 2.1 will be used by default.
  • team-id - The Team ID of the team that the projects should be added to.
  • poc-email - (optional) The email address of the point of contact for all projects being created.
  • poc-name- (optional) The name of the point of contact for all projects being created.

Was this article helpful?

What's Next