Configuring the GitLab Script variables

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 GitLab CI/CD Website.

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.

Last updated