-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
91 lines (85 loc) · 3.3 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
91 lines (85 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
stages:
- verify
- deploy
default:
# Default image
image: registry.orekit.org/orekit/ci-utils/maven:3.9.6-eclipse-temurin-11
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
cache:
paths:
- .m2/repository
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: "-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: "-s .CI/maven-settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
SONAR_PROJECT_KEY: "${CI_PROJECT_NAMESPACE}:${CI_PROJECT_NAME}"
SONAR_PROJECT_NAME: "${CI_PROJECT_TITLE} (${CI_PROJECT_NAMESPACE}:${CI_PROJECT_NAME})"
# Deployment target properties
TARGET_URL_PREFIX: "cochise@ganymede.orekit.org:/var/www/mvn-sites/site-rugged"
verify:
stage: verify
script:
- mvn $MAVEN_CLI_OPTS checkstyle:check verify site
- test -z "$SONAR_TOKEN" || mvn $MAVEN_CLI_OPTS sonar:sonar
-Dsonar.host.url=${SONAR_HOST_URL}
-Dsonar.login=${SONAR_TOKEN}
-Dsonar.branch.name=${CI_COMMIT_REF_NAME}
-Dsonar.projectKey="$SONAR_PROJECT_KEY"
-Dsonar.projectName="$SONAR_PROJECT_NAME"
-Dsonar.qualitygate.wait=true
artifacts:
paths:
- target/*.jar
- target/site
reports:
junit:
- target/surefire-reports/*.xml
verify:warning:
stage: verify
script:
- echo "Please, configure SonarQube by following steps described in the contribution guide:"
- echo "https://www.orekit.org/site-rugged-development/contributing.html"
- exit 1
allow_failure: true
rules:
- if: $SONAR_TOKEN == null
# On main branches (develop, release-*, main) the produced artifacts are
# deployed on the Nexus of the project (https://packages.orekit.org/)
deploy:artifacts:
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS javadoc:jar source:jar deploy -DskipTests=true -Prelease,ci-deploy
artifacts:
paths:
- target/*.jar
- target/*.asc
only:
- main@orekit/rugged
- /^release-[.0-9]+$/@orekit/rugged
- develop@orekit/rugged
deploy:site:
stage: deploy
before_script:
# Prepare the SSH environment required to push documentation onto the server
- eval $(ssh-agent -s)
- echo "$SSH_SECRET_KEY" | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
script:
- PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- rsync -rz --links --checksum --no-perms --chmod=u=rwX,go=rX --delete-after
target/site/ ${TARGET_URL_PREFIX}-${PROJECT_VERSION}
only:
- main@orekit/rugged
- /^release-[.0-9]+$/@orekit/rugged
- develop@orekit/rugged