.gitlab-ci.yml 1.33 KB
Newer Older
sunye's avatar
sunye committed
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
image: docker-registry.univ-nantes.fr/sunye-g/docker-java-maven:latest

variables:
  MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dhttps.proxyHost=proxy-serveur.univ-nantes.prive -Dhttps.proxyPort=3128"
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

cache:
  paths:
    - .m2/repository/
  key: "$CI_BUILD_REF_NAME"

build:
  stage: build
  script:
    - java -version
    - mvn -version
    - 'mvn --settings ./.gitlab.maven.settings.xml $MAVEN_OPTS -e $MAVEN_CLI_OPTS compile'
  artifacts:
    paths:
      - target/
      - salut-common/target
      - salut-cache/target

verify:
  stage: test
  script:
    - 'mvn --settings ./.gitlab.maven.settings.xml $MAVEN_OPTS verify'
  artifacts:
    paths:
      - target/
      - salut-common/target
      - salut-cache/target

pages:
  stage: deploy
  script:
  - 'mvn --settings .gitlab.maven.settings.xml $MAVEN_OPTS -e $MAVEN_CLI_OPTS compile site'
  - mkdir -p public/salut-common
  - mkdir -p public/salut-cache
  - rsync -r target/site/ public
  - rsync -r salut-common/target/site/ public/salut-common
  - rsync -r salut-cache/target/site/ public/salut-cache
  artifacts:
    paths:
    - public
  only:
  - master