From 4199a6a4ea45c38b547766510286f8cea253d98c Mon Sep 17 00:00:00 2001 From: Victor Zagorodny Date: Fri, 15 Mar 2019 16:21:35 +0000 Subject: Point QA_REF for Maven project to a failing test This is done to ensure that the tool truly skips the "test" phase and thus ignores the failing test --- .gitlab-ci.yml | 2 +- CHANGELOG.md | 5 +++++ README.md | 26 +++++++++++++++++++++++++- run.sh | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5668f2..0b9a51e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,7 +78,7 @@ QA:java-maven: extends: .QA variables: QA_PROJECT: java-maven - QA_REF: ccec8318 + QA_REF: bab3d5b0 QA:python-pip: extends: .QA diff --git a/CHANGELOG.md b/CHANGELOG.md index 65acbc0..5818e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # GitLab License management changelog +## v1.2.3 + +- Add ability to configure the `mvn install` execution for Maven projects via `MAVEN_CLI_OPTS` (!24) +- Skip `"test"` phase by default when running `mvn install` for Maven projects (!24) + ## v1.2.2 - Bump LicenseFinder to 5.6.2 diff --git a/README.md b/README.md index ea4ecbd..9695d35 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,15 @@ docker run --rm --volume "/path/to/my/project":/code license-management analyze You can run integration tests on the image like this: ```sh -docker run --rm license-management /test/test.sh +docker run --rm license-management /test/test.sh project_name git_ref ``` +where: + +- `project_name` is the project slug among the +[test projects for security products](https://gitlab.com/gitlab-org/security-products/tests/) (e.g. `java-maven`) +- `git_ref` is the Git ref to checkout and scan against (e.g. `master`) + ## Supported languages and package managers The following table shows which languages and package managers are supported. @@ -67,6 +73,24 @@ and run your custom command to setup your environment with a custom package mana registry.gitlab.com/gitlab-org/security-products/license-management:latest analyze /code ``` +## Settings + +The License Management tool can be customized with environments variables for some project types. + +| Environment variable | Project type | Function | +|----------------------|--------------|----------| +| MAVEN_CLI_OPTS | Java (Maven) | Additional arguments for the mvn executable. If not supplied, defaults to `-DskipTests`. | + + +Inject the required environment variables to the docker command using the [`--env` option flag](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) +or its shorthand form (`--env MY_SETTING_VAR`) if the configuration comes from an external environment. + + +*Caution:* if you supply the `MAVEN_CLI_OPTS` for a Maven project, don't forget to append `-DskipTests` to save time by skipping the test suite. + +*Tip:* in case you still need to run tests during license management check, supply `MAVEN_CLI_OPTS=-DskipTests=false` +to the docker command. + ## Versioning and release process diff --git a/run.sh b/run.sh index aad51a5..822b85c 100755 --- a/run.sh +++ b/run.sh @@ -153,7 +153,7 @@ case "$COMMAND" in if test -f pom.xml ; then # Install Java Maven dependencies. - mvn install + mvn install "${MAVEN_CLI_OPTS:--DskipTests}" fi if test -f build.gradle ; then -- cgit v1.2.3