Commit 7422b105 authored by Antoine Mottier's avatar Antoine Mottier
Browse files

Resync with MRL CI template

Use the latest version of template in order to get a clean copy of git repository.
parent fd744789
Pipeline #15190 failed with stages
in 2 seconds
......@@ -32,22 +32,45 @@ variables:
PROJECT_GIT_URL: '$GIT_SERVER_URL/$GIT_GROUP_NAME/$GIT_PROJECT_NAME.git'
## Scancode
SCANCODE_IGNORE: '--ignore build --ignore target'
### Variables
SCANCODE_OPTIONS_PROJECT_SPECIFIC: ''
### Constants
SCANCODE_OPTIONS: '-n 2 --timeout 7200 -l $SCANCODE_OPTIONS_PROJECT_SPECIFIC'
SCANCODE_FILENAME: 'scancode-$OW2_PROJECT_NAME.json'
## Options shared for several build automation tools
## Java
### Variables
TEST_JAVA_VERSION: '11'
SONARQUBE_JAVA_VERSION: '11'
## Maven
### Variables
# Maven version
MAVEN_VERSION: '3.8.1'
# Project specific Maven CLI options
MAVEN_CLI_OPTS_PROJECT_SPECIFIC: ''
# Project specific Maven options
MAVEN_OPTS_PROJECT_SPECIFIC: ''
### Constants
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
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_OPTS is automatically sourced by Maven (no need to add it on the command line)
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_OPTS_PROJECT_SPECIFIC'
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true'
# Project specific Maven option
MAVEN_CLI_OPTS_PROJECT_SPECIFIC: '-P jre11,development'
MAVEN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true $MAVEN_CLI_OPTS_PROJECT_SPECIFIC'
## Gradle
# GRADLE_OPTS: '-Dorg.gradle.daemon=false'
### Variables
# GRADLE_OPTS_PROJECT_SPECIFIC: ''
### Constants
# GRADLE_OPTS: '-Dorg.gradle.daemon=false $GRADLE_OPTS_PROJECT_SPECIFIC'
## SonarQube
### Constants
SONAR_URL: 'https://sonarqube.ow2.org'
## Specific to Waarp as Maven start Docker container using Testcontainers Maven plugin / Java library
# Because tls_verify = false on the DinD runner
......@@ -60,31 +83,32 @@ services:
# alias to avoid hostname based on image name
alias: docker
#before_script:
# - export GRADLE_USER_HOME=`pwd`/.gradle
#before_script:
# - export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
# Maven
- .m2/repository
# Gradle
# - build
# - .gradle
clonerepo:
tags:
- scancode
stage: clone
script:
- '[ -d $PROJECT_SOURCES_DIR ] && (cd $PROJECT_SOURCES_DIR && git fetch) || (cd $PROJECT_SOURCES_BASEDIR && git clone $PROJECT_GIT_URL $PROJECT_CHECKOUT_DIR_RELATIVE_PATH)'
- 'cd $PROJECT_SOURCES_DIR && git checkout origin/$GIT_BRANCH_NAME'
- 'cd $PROJECT_SOURCES_DIR && git clean -dfxq && git reset --hard origin/$GIT_BRANCH_NAME'
scancode:
tags:
- scancode
stage: scan
script:
- ls -la
- '$HOME/scancode $SCANCODE_IGNORE -n 2 --timeout 7200 -l --json=$SCANCODE_FILENAME $PROJECT_SOURCES_DIR'
- '$HOME/scancode $SCANCODE_OPTIONS --json=$SCANCODE_FILENAME $PROJECT_SOURCES_DIR'
- echo "If scancode ran properly, the output file is available at ${CI_PROJECT_URL}/-/jobs/artifacts/master/raw/${SCANCODE_FILENAME}?job=${CI_JOB_NAME}"
artifacts:
paths:
# will produce a json file available at:
......@@ -94,8 +118,8 @@ scancode:
test:
tags:
- dind
image: maven:3.6.3-openjdk-11
# image: gradle:6.8.3-jdk11
image: 'maven:$MAVEN_VERSION-openjdk-$TEST_JAVA_VERSION'
# image: 'openjdk:$TEST_JAVA_VERSION'
stage: test
script:
- 'cd $PROJECT_SOURCES_DIR'
......@@ -110,10 +134,10 @@ test:
sonar:
tags:
- dind
image: maven:3.6.3-openjdk-11
# image: gradle:6.8.3-jdk11
image: 'maven:$MAVEN_VERSION-openjdk-$SONARQUBE_JAVA_VERSION'
# image: 'openjdk:$SONARQUBE_JAVA_VERSION'
stage: sonar
script:
- 'cd $PROJECT_SOURCES_DIR'
- 'mvn $MAVEN_CLI_OPTS $MAVEN_CLI_OPTS_PROJECT_SPECIFIC -Dsonar.projectKey=${OW2_PROJECT_NAME} sonar:sonar'
# - './gradlew sonarqube -Dsonar.host.url=${SONAR_URL} -Dsonar.login=${SONAR_LOGIN} -DprojectName=${OW2_PROJECT_NAME}
- 'mvn $MAVEN_CLI_OPTS $MAVEN_CLI_OPTS_PROJECT_SPECIFIC -Dsonar.host.url=${SONAR_URL} -Dsonar.login=${SONAR_LOGIN} sonar:sonar'
# - './gradlew sonarqube -Dsonar.host.url=${SONAR_URL} -Dsonar.login=${SONAR_LOGIN}'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment