Skip to content
Snippets Groups Projects
Commit a46a2368 authored by Daniel Dehennin's avatar Daniel Dehennin
Browse files

feat(maven): ensure quality criteria are met with `.maven:verify`

USAGE
=====

include:
  - project: EOLE/Infra/ci-tools
    ref: stable
    file: /templates/Maven.yaml

stages:
  - test

maven verify: {extends: '.maven:verify'}
parent 92d822d4
No related branches found
No related tags found
3 merge requests!66Publish new release,!65Prepare new release,!63Resolve "Add CI templates for Java Maven projects"
......@@ -6,6 +6,9 @@
# - `.maven:validate`: validate the project is correct and all
# necessary information is available
#
# - `.maven:verify`: run any checks on results of integration tests to
# ensure quality criteria are met
#
# - `.maven:base`: base template job used to factorize variables
# declaration
#
......@@ -69,6 +72,60 @@
- echo -e "\e[0Ksection_end:$(date +%s):maven-validate\r\e[0K"
#
# .maven:verify
# =============
#
# Run any checks on results of integration tests to ensure quality
# criteria are met.
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Maven.yaml
#
# stages:
# - test
#
# maven verify: {extends: '.maven:verify'}
#
# REQUIREMENTS
# ============
#
# - a `test` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need.
#
# - the `.on-branch` rules templates or it must be overriden by
# the extending job to feet your need
#
# OPTIONAL VARIABLES
# ==================
#
# - `SRC_DIR`: directory of the java sources containing the `pom.xml`,
# default to `.`
#
# - `MAVEN_IMAGE`: name of the `maven` docker image to use
#
# - `MAVEN_OPTS`: default to "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.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`: default to "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
#
# - `MAVEN_CLI_ARGS`: optional arguments to pass to `maven verify`
# command, empty by default
#
# USED CI VARIABLES
# =================
#
.maven:verify:
stage: test
extends: .maven:base
script:
- echo -e "\e[0Ksection_start:$(date +%s):maven-verify\r\e[0KExecute 'mvn verify -f ${SRC_DIR} ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}'"
- mvn verify -f "${SRC_DIR}" ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}
- echo -e "\e[0Ksection_end:$(date +%s):maven-verify\r\e[0K"
.maven:base:
image: ${MAVEN_IMAGE}
extends: .on-branch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment