Unified Language User Guides
iCR User Guide 4.2
iCR User Guide 4.2
  • Table of contents
    • Introduction
    • Overview
    • Authorizing Access to Your Source Code
      • Authenticating GitHub Access with a Cloud-Based VCS Repository Service
        • Authenticating GitHub Access with a Private VCS Repository
      • Authenticating GitLab Access with a Cloud-Based VCS Repository
        • Authenticating GitLab Access with a Private VCS Repository
      • Authenticating Bitbucket Access with a Cloud-Based VCS Repository
    • Using the Navigator
      • Connecting to the Navigator
      • Setting your User Password
      • The Navigator top banner
      • The Analysis Engine status
      • Selecting Your Source Code
        • Using a cloud-based VCS
        • Selecting your branch
        • Using a private VCS
        • Using a local project
        • Limiting the files to be analyzed
      • Integrating with your bug tracking system
        • Integrating with Jira - Define Your Project
        • Integrating with Jira - Authorizing Access for iCR
        • Integrating with Jira - Connecting with iCR
    • Using the Analysis Engine
      • Initiating an analysis
      • Monitoring the analysis
      • Interrupting the analysis
    • Reviewing your results
    • When you are complete
    • Integrating iCR Into Your CI/CD Workflows
      • Jenkins Workflow
        • Installing the plugin
        • Configuring the plugin
          • Creating a Personal Access Token
          • Copying Your Repository's URL
        • Viewing the Results
      • GitHub Actions Workflow
        • Workflow Overview
        • Preparing and Registering the Docker Image
        • Adding a Workflow to a Repository
        • Preparing the GitHub Workflow
          • Environment Variables
          • User Supplied Secrets
          • Setting the User Defined Secrets Values
        • Executing the Workflow
      • GitLab Workflow
        • Workflow Overview
        • Preparing the Docker Image
        • Configuring the GitLab Script variables
          • Environment Variables
          • User Supplied Variables
          • Creating a Personal Access Token
          • Setting the User Defined Variable Values
        • Executing the Workflow
      • Multiple Workflows
    • Appendix – Language Specific Fixer Lists
    • Appendix – Example Summary Report
    • Appendix - Sample Bug Listing
    • Appendix - Getting a BitBucket App Password for JENKINS
Powered by GitBook
On this page
  1. Table of contents
  2. Integrating iCR Into Your CI/CD Workflows
  3. GitLab Workflow

Configuring the GitLab Script variables

PreviousPreparing the Docker ImageNextEnvironment Variables

Last updated 10 months ago

To trigger a workflow in GitLab CI/CD a special yml script to invoke the container is inserted into the project’s repository. This script MUST be named: .gitlab-ci.yml. OpenRefactory supplies a sample script for use with GitLab CI/CD. This script can be incorporated into a previous workflow script or edited to make the workflow operate as needed. Let’s quickly review the sample script:

stages:
  - iCR

iCR:
  image: registry.gitlab.com/or-testuser/orbot/icr-gitlab:latest
  stage: iCR
  script:
    - '/workspace/configure_run.sh ${CI_PROJECT_ID} ${CI_COMMIT_BRANCH} ${CI_PROJECT_URL} ${OR_ICR_URL} ${OR_ICR_USER_NAME} ${OR_ICR_CI_CD_ACCESS_TOKEN} ${OR_PERSONAL_ACCESS_TOKEN} ${OR_MAIL_ADDRESS} ${OR_LANGUAGE_VERSION}'

If this script exists in a repository, then it will be checked whenever an event occurs that affects the repository. You can learn more about how GitLab CI/CD works by checking out the .

There are 2 key sections to the script. The image section is where the name of the docker component to be executed can be found. This is the component that will connect securely to the Navigator and initiate an analysis.

The script section invokes the component with a number of important variables. The variables are needed to be able to locate the targeted iCR server and to provide the Navigator with the information required so it can authenticate itself with the proper username and identify the project and branch name.

There are 9 variables in the script. Let’s look at all of them. They are broken into 2 groups: preconfigured environment variables and user supplied variables.

GitLab CI/CD Website