Synopsis

mod-connect gitlab [--downloadCLI] [--skipSSL] [--verbose] [--buildJobRetries=<buildJobRetries>] [--cliVersion=<cliVersion>] [--commandSuffix=<commandSuffix>] [--defaultBranch=<defaultBranch>] [--dockerImageBuildJob=<dockerImageBuildJob>] [--dockerImageDownloadJob=<dockerImageDownloadJob>] [--downloadCLIPasswordSecret=<downloadCLIPasswordSecretName>] [--downloadCLITokenSecret=<downloadCLITokenSecretName>] [--downloadCLIUrl=<downloadCLIUrl>] [--downloadCLIUserNameSecret=<downloadCLIUserNameSecretName>] --fromCsv=<fromCsv> [--jobTag=<jobTag>] [--platform=<platform>] [--prefix=<prefix>] --publishPwdSecretName=<publishPwdSecretName> --publishUrl=<publishUrl> --publishUserSecretName=<publishUserSecretName> [--repositoryAccessTokenSecretName=<repositoryAccessTokenSecr _ etName>_] [--repositoryAccessUserSecretName=<repositoryAccessUserSecret _ Name>_] [--moderneUrl=<moderneUrl> --moderneToken=<moderneToken> --moderneTokenSecret=<moderneTokenSecret>]

Description

Creates a GitLab job for each configured repository that will build and publish LST artifacts to your artifact repository on a regular basis.

Example:

mod connect gitlab\
   --fromCsv /path/to/repos.csv \
   --publishUserSecretName publishUserSecretName \
   --publishPwdSecretName publishPwdSecretName \
   --publishUrl https://artifact-place.com/artifactory/moderne-ingest

Options

--buildJobRetries=<buildJobRetries>

Retries to attempt for the build job. Options are: 0, 1 or 2.

Default: 0

--cliVersion=<cliVersion>

The version of the Moderne CLI that should be used when running GitLab jobs.

--commandSuffix=<commandSuffix>

The suffix that should be appended to the Moderne CLI command when running GitLab jobs.

Example: --dry-run

--defaultBranch=<defaultBranch>

If no Git branch is specified for a repository in the CSV file, the GitLab job will attempt to checkout this branch when pulling down the code.

Default: main

--dockerImageBuildJob=<dockerImageBuildJob>

The full name of the docker image to run the build jobs on.

This image requires both git and a JDK to be present.

Example: "registry.example.com/my/image:latest"

--dockerImageDownloadJob=<dockerImageDownloadJob>

The full name of the docker image to run the download job on.

This image should be based on unix and requires curl to be present.

Example: "registry.example.com/my/image:latest"

--downloadCLI

Specifies whether or not the Moderne CLI should be downloaded at the beginning of each run.Should be set to true when the base image does not include the CLI

Default: false

--downloadCLIPasswordSecret=<downloadCLIPasswordSecretName>

The name of the GitLab secret that contains the password needed to download the CLI

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--downloadCLITokenSecret=<downloadCLITokenSecretName>

The name of the GitLab secret that contains a Bearer token needed to download the CLI

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--downloadCLIUrl=<downloadCLIUrl>

Specifies an internal URL to download the CLI from if you’d prefer to host the CLI yourself.

--downloadCLIUserNameSecret=<downloadCLIUserNameSecretName>

The name of the GitLab secret that contains the username needed to download the CLI

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--fromCsv=<fromCsv>

The location of the CSV file containing the list of repositories that should be ingested. One GitLab job will run for each repository. Follows the schema of:

[repoName,repoBranch,desiredStyle,additionalBuildArgs,skip,skipReason]

  • repoName: Required - The repository that should be ingested. Follows the format of: organization/repository.

    • Example: openrewrite/rewrite

  • repoBranch: Optional - The branch of the above repository that should be ingested.

    • Default: main

  • desiredStyle: Optional - The OpenRewrite style name to apply during ingest.

    • Example: org.openrewrite.java.SpringFormat

  • additionalBuildArgs: Optional - Additional arguments that are added to the Maven or Gradle build command.

    • Example: -Dmaven.antrun.skip=true

  • skip: Optional - If set to true, this repo will not be ingested.

    • Default: false

  • skipReason: Optional - The context for why the repo is being skipped.

    CSV Example:

    ,openrewrite/rewrite-spring,main,,gradle,,,,,
    ,openrewrite/rewrite-java-migration,main,,gradle,,,,,
    additional rows...
--jobTag=<jobTag>

If specified, GitLab jobs will be tagged with this value for runners to pick up.

--moderneToken=<moderneToken>

A personal access token for the Moderne tenant.

Note you can also use --moderneTokenSecret if you want to use a secret variable

--moderneTokenSecret=<moderneTokenSecret>

A secret containing a personal access token for the Moderne tenant.

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--moderneUrl=<moderneUrl>

The URL of the Moderne tenant.

--platform=<platform>

The OS platform for the Gitlab runner. The possible options are: windows, linux, or macos.

Default: linux

--prefix=<prefix>

If specified, GitLab jobs will only be created for repositories that start with this prefix.

--publishPwdSecretName=<publishPwdSecretName>

The name of the GitLab secret that contains the password needed to upload LST artifacts to your artifact repository.

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--publishUrl=<publishUrl>

The URL of the Maven formatted artifact repository where LST artifacts should be uploaded to.

Will default to the environment variable MODERNE_PUBLISH_URL if one exists.

--publishUserSecretName=<publishUserSecretName>

The name of the GitLab secret that contains the username needed to upload LST artifacts to your artifact repository.

GitLab secrets can be created inside of the Settings → CI/CD, find Variables and click on the Expand button inside your GitLab repository.

--repositoryAccessTokenSecretName=<repositoryAccessTokenSecretName>

The name of the secret containing the token that has access to the repositories in the CSV. This can be a personal or group access token.

The minimum required grant is read_repository.

If no token is specified, the $CI_JOB_TOKEN is used.

--repositoryAccessUserSecretName=<repositoryAccessUserSecretName>

The name of the secret containing the username that has access to the repositories in the CSV. This can be a personal username or group name.

The minimum required grant is read_repository.

If no token is specified, the $CI_JOB_TOKEN is used.

--skipSSL

If this parameter is included, SSL verification will be skipped when pushing to artifactory.

Default: false

--verbose

If enabled, additional debug statements will be printed.

Default: false