.gitlab-ci.yml 484 Bytes
Newer Older
Gradl, Tobias's avatar
Gradl, Tobias committed
1
2
3
image: maven:latest

variables:
Gradl, Tobias's avatar
Gradl, Tobias committed
4
  MAVEN_CLI_OPTS: "--batch-mode"
Gradl, Tobias's avatar
Gradl, Tobias committed
5
6
7
8

build:
  stage: build
  script:
Gradl, Tobias's avatar
Gradl, Tobias committed
9
    - mvn $MAVEN_CLI_OPTS compile
Gradl, Tobias's avatar
Gradl, Tobias committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

test:
  stage: test
  script:
    - mvn $MAVEN_CLI_OPTS test

deploy:
  stage: deploy
  script:
    - VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) 
    - |
      if [[ $VERSION = *"SNAPSHOT" || $VERSION = *"RELEASE" ]]; then
        echo "Pushing $VERSION"
        mvn $MAVEN_CLI_OPTS deploy
      fi
  only:
    - master