Skip to content

Instantly share code, notes, and snippets.

@kuang-da
Created November 27, 2021 23:35
Show Gist options
  • Save kuang-da/1246132aea97771c61462d465da1ea7e to your computer and use it in GitHub Desktop.
Save kuang-da/1246132aea97771c61462d465da1ea7e to your computer and use it in GitHub Desktop.
[gitlab-ci]
default:
image: 'maven:3.8.1-openjdk-11'
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end"
DOCKER_IMAGE_TO_SCAN: hello-webapp:latest
# Cache the Maven repository so that each job does not have to download it.
cache:
key: mavenrepo
paths:
- ./.m2/repository/
stages:
- build
# Run tests.
test:
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS install'
tags:
- CHUZHI_JOB_RUNNER
# Checkstyle source code standard review.
#checkstyle:
# stage: build
# script:
# - 'mvn $MAVEN_CLI_OPTS -Pcicdprofile checkstyle:check'
# tags:
# - CHUZHI_JOB_RUNNER
# PMD code quality analysis.
#pmd:
# stage: build
# script:
# - 'mvn $MAVEN_CLI_OPTS -Pcicdprofile pmd:check'
# SpotBugs code quality analysis.
#spotbugs:
# stage: build
# script:
# - 'mvn $MAVEN_CLI_OPTS -Pcicdprofile spotbugs:check'
# Test code coverage analysis.
#code-coverage:
# stage: build
# script:
# - 'mvn $MAVEN_CLI_OPTS -P-Pcicdprofile install'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment