From ac7c8790d9e1ad4e04afadff6f68d74766e06c34 Mon Sep 17 00:00:00 2001 From: andrewsouthard1 Date: Thu, 11 Nov 2021 17:39:50 -0500 Subject: [PATCH] Adding example for a Java Gradle Application using Snyk Gradle-Plugin --- GitLabCICD/gitlab-gradle.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 GitLabCICD/gitlab-gradle.yml diff --git a/GitLabCICD/gitlab-gradle.yml b/GitLabCICD/gitlab-gradle.yml new file mode 100644 index 0000000..36da98f --- /dev/null +++ b/GitLabCICD/gitlab-gradle.yml @@ -0,0 +1,43 @@ +# Example for a Java Gradle Application using Snyk Gradle-Plugin +image: gradle:slim + +variables: + GRADLE_OPTS: "-Dorg.gradle.daemon-false" + +before_script: + - export GRADLE_USER + +stages: + - build + - test + - snyktest + +build: + stage: build + script: ./gradlew --build-cache assemble + cache: + key: "$CI_COMMIT_REF_NAME" + policy: push + paths: + - build + - .gradle + +test: + stage: test + script: ./gradlew check + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull + paths: + - build + - .gradle + +snyktest: + stage: snyktest + script: gradle snyk-monitor + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull + paths: + - build + - .gradle