This repository has been archived on 2023-06-06. You can view files and clone it, but cannot push or open issues or pull requests.
better-tp/.gitlab-ci.yml
2018-09-05 20:11:38 +02:00

61 lines
2.2 KiB
YAML

# This file is a template, and might need editing before it works on your project.
---
variables:
# This will supress 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: "-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"
# 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"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
cache:
paths:
- .m2/repository
# For `master` branch run `mvn deploy` automatically.
# Here you need to decide whether you want to use JDK7 or 8.
# To get this working you need to define a volume while configuring your gitlab-ci-multi-runner.
# Mount your `settings.xml` as `/root/.m2/settings.xml` which holds your secrets.
# See https://maven.apache.org/settings.html
Build:
# Use stage test here, so the pages job may later pickup the created site.
stage: build
script:
- mvn -B clean install
- mvn -B test
# Archive up the built documentation site.
artifacts:
paths:
- target/
image: maven
Test:
# Use stage test here, so the pages job may later pickup the created site.
stage: test
script:
- mvn -B test
# Archive up the built documentation site.
artifacts:
paths:
- target/
image: maven
Deploy:
# Use stage test here, so the pages job may later pickup the created site.
stage: deploy
script:
- cp ./settings-security.xml $HOME/.m2/settings-security.xml
- cp ./settings.xml $HOME/.m2/settings.xml
- mvn -B deploy
only:
- tags
# Archive up the built documentation site.
artifacts:
paths:
- target
image: maven