Meterian
Search…
Sample Unity Project
Using the Java thin client for the specific step
A sample project based on Unity is available on GitLab. This example uses a minimal base docker image and the Java Thin Client, as the Unity scanner does not require any special tooling, as this scanner reads directly the manifest files of the project ( manifest.json and packages-lock.json) to produce the bill of materials and detect any vulnerable or out of date component.
The YAML configuration for this pipeline is straightforward:
1
meterian-analysis:
2
3
image:
4
name: openjdk:11.0.6-jre-buster
5
6
stage: test
7
script:
8
- curl -o /tmp/meterian-cli.jar -O -J -L -s https://www.meterian.com/downloads/meterian-cli.jar
9
- java -jar /tmp/meterian-cli.jar --scan-unity=true --scan-nodejs=false
10
--project-branch=$CI_COMMIT_BRANCH --project-commit=$CI_COMMIT_SHA
11
Copied!
Note that we are using the OpenJdk mini image, which we need to run a Java program. Then we simply download the Meterian Java Thin client and we run it with Java at the root of the project. Note that we collect the project branch and the project commits from the GitLab pipeline variables (see the official GitLab reference).
Note also that, in the case of Unity, we have to explicitly enable the Unity scanner engine (--scan-unity=true) and, at the same time, disable the NodeJS scanner (--scan-nodejs=false).
Last modified 3mo ago
Copy link