Commit 0e373047 authored by René Link's avatar René Link
Browse files

gitlab pipeline

parent 805d60df
# This file is a template, and might need editing before it works on your project.
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
# This template will build and test your projects
# * Caches downloaded dependencies and plugins between invocation.
# * Verify but don't deploy merge requests.
# * Deploy built artifacts from master branch only.
stages:
- test
- deploy
- release
variables:
# 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"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `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"
# This template uses jdk11 for verifying and deploying images
image: maven:3-jdk-8
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify: &verify
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS verify'
except:
- master
# Verify merge requests using jdk11
verify:jdk11:
<<: *verify
# To deploy packages from CI, create a ci_settings.xml file
# For deploying packages to GitLab's Maven Repository: See https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#creating-maven-packages-with-gitlab-cicd for more details.
# Please note: The GitLab Maven Repository is currently only available in GitLab Premium / Ultimate.
# For `master` branch run `mvn deploy` automatically.
deploy:
stage: deploy
script:
- if [ ! -f ci_settings.xml ];
then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#creating-maven-packages-with-gitlab-cicd for instructions.";
fi
- 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
only:
- master
release:
stage: release
script:
- git config --global user.name "René Link"
- git config --global user.email "rene.link@link-intersystems.com"
- git checkout -B "$CI_BUILD_REF_NAME"
- mvn -s ci_settings.xml -B release:prepare release:perform
when: manual
only:
refs:
- master
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>scm</id>
<username>${env.SCM_USER}</username>
<password>${env.SCM_PASS}</password>
</server>
<server>
<id>mirror</id>
<username>${env.MVN_USER}</username>
<password>${env.MVN_PASS}</password>
</server>
<server>
<id>releases</id>
<username>${env.MVN_USER}</username>
<password>${env.MVN_PASS}</password>
</server>
<server>
<id>snapshots</id>
<username>${env.MVN_USER}</username>
<password>${env.MVN_PASS}</password>
</server>
<server>
<id>plugin-releases</id>
<username>${env.MVN_USER}</username>
<password>${env.MVN_PASS}</password>
</server>
<server>
<id>plugin-snapshots</id>
<username>${env.MVN_USER}</username>
<password>${env.MVN_PASS}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>mirror</id>
<mirrorOf>central</mirrorOf>
<name>Mirror Repository</name>
<url>${env.MVN_MIRROR_REPO_URL}</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>ci</id>
<repositories>
<repository>
<id>releases</id>
<name>Releases</name>
<url>${env.MVN_RELEASES_REPO_URL}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<name>Snapshots</name>
<url>${env.MVN_SNAPSHOTS_REPO_URL}</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>plugin-releases</id>
<name>Plugin Releases</name>
<url>${env.MVN_PLUGIN_RELEASES_REPO_URL}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>plugin-snapshots</id>
<name> Plugin Snapshots</name>
<url>${env.MVN_PLUGIN_SNAPSHOTS_REPO_URL}</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>ci</activeProfile>
</activeProfiles>
</settings>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.link_intersystems</groupId>
<artifactId>lis-pom</artifactId>
......@@ -8,14 +10,15 @@
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.scm.id>scm</project.scm.id>
</properties>
<scm>
<connection>scm:git:https://github.com/link-intersystems/lis-pom.git</connection>
<developerConnection>scm:git:https://github.com/link-intersystems/lis-pom.git</developerConnection>
<connection>scm:git:${env.GIT_REPO_URL}</connection>
<developerConnection>scm:git:${env.GIT_REPO_URL}</developerConnection>
<url>https://github.com/link-intersystems/lis-pom</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>github</system>
......@@ -53,13 +56,13 @@
<distributionManagement>
<repository>
<id>link-intersystems-releases</id>
<id>releases</id>
<layout>default</layout>
<name>Link Intersystem Releases</name>
<url>https://nexus.link-intersystems.com/repository/open-source-releases/</url>
</repository>
<snapshotRepository>
<id>link-intersystems-snapshots</id>
<id>snapshots</id>
<layout>default</layout>
<name>Link Intersystem Snapshots</name>
<url>https://nexus.link-intersystems.com/repository/open-source-snapshots/</url>
......@@ -137,7 +140,7 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<!-- Prepares the property pointing to the JaCoCo runtime agent which
<!-- Prepares the property pointing to the JaCoCo runtime agent which
is passed as VM argument when Maven the Surefire plugin is executed. -->
<execution>
<id>pre-unit-test</id>
......@@ -147,12 +150,12 @@
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
<!-- Sets the name of the property containing the settings for JaCoCo
<!-- Sets the name of the property containing the settings for JaCoCo
runtime agent. -->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for unit tests is created
<!-- Ensures that the code coverage report for unit tests is created
after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
......
Markdown is supported
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