Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • EOLE/infra/ci-tools
  • daniel.dehennin/ci-tools
2 results
Show changes
Commits on Source (9)
# Changelog
## [1.12.0](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/compare/release/1.11.1...release/1.12.0) (2022-07-05)
### Features
* **maven:** copy package to remote repository with `.maven:deploy` ([b72b0a8](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/b72b0a821fd32c065fc7cf60b3a344003c46b373))
* **maven:** ensure quality criteria are met with `.maven:verify` ([a46a236](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/a46a23683add58623bae5c6ce1b4e8367705923f))
* **maven:** validate the project with `.maven:validate` ([92d822d](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/92d822d48d6bac266f4ffaa891217280d36b68ba))
### Bug Fixes
* **maven:** define `SRC_DIR` variable ([8d8a6af](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/8d8a6af8249923dc027c37cf53c7dec9c6f0dedb))
### [1.11.1](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/compare/release/1.11.0...release/1.11.1) (2022-06-28)
......
# -*- mode: yaml; coding: utf-8 -*-
# vim: ft=yaml
#
# Hidden template jobs to be used in `.gitlab-ci.yml`
#
# - `.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:deploy`: copies the final package to the remote repository
#
# - `.maven:base`: base template job used to factorize variables
# declaration
#
---
#
# .maven:validate
# ===============
#
# Validate the project is correct and all necessary information is
# available.
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Maven.yaml
#
# stages:
# - lint
#
# maven validate: {extends: '.maven:validate'}
#
# REQUIREMENTS
# ============
#
# - a `lint` 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 validate`
# command, empty by default
#
# USED CI VARIABLES
# =================
#
.maven:validate:
stage: lint
extends: .maven:base
cache:
# This job update dependencies
policy: pull-push
script:
- echo -e "\e[0Ksection_start:$(date +%s):maven-validate\r\e[0KExecute 'mvn validate -f ${SRC_DIR} ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}'"
- mvn validate -f "${SRC_DIR}" ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}
- 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:deploy
# =============
#
# Copies the final package to the remote repository for sharing with
# other developers and projects.
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Maven.yaml
#
# stages:
# - release
#
# maven deploy: {extends: '.maven:deploy'}
#
# REQUIREMENTS
# ============
#
# - a `release` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need.
#
# - the `.on-stable` 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 deploy`
# command, empty by default
#
# USED CI VARIABLES
# =================
#
.maven:deploy:
stage: release
extends:
- .maven:base
- .on-stable
script:
- echo -e "\e[0Ksection_start:$(date +%s):maven-deploy\r\e[0KExecute 'mvn deploy -s ci_settings.xml -f ${SRC_DIR} ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}'"
- mvn deploy -f "${SRC_DIR}" ${MAVEN_CLI_OPTS} ${MAVEN_CLI_ARGS}
- echo -e "\e[0Ksection_end:$(date +%s):maven-deploy\r\e[0K"
.maven:base:
image: ${MAVEN_IMAGE}
extends: .on-branch
variables:
SRC_DIR: '.'
MAVEN_IMAGE: hub.eole.education/proxyhub/library/maven:3.8.6-openjdk-8-slim
MAVEN_OPTS: "-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: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
MAVEN_CLI_ARGS: ""
cache:
key:
files:
- pom.xml
paths:
- .m2/repository
# Validate will push the cache
policy: pull
...