ci.yml 1.43 KB
Newer Older
1
image: atlassianlabs/docker-node-jdk-chrome-firefox
2

3
build:
4
5
6
    only:
        - master
        - merge_requests
Thomas Beermann's avatar
Thomas Beermann committed
7
8
        - branches
        - tags
9
    stage: build
10
    script: mvn compile
11

12
test:
13
14
15
    only:
        - master
        - merge_requests
Thomas Beermann's avatar
Thomas Beermann committed
16
17
        - branches
        - tags
18
    stage: test
19
    script: mvn test
20

21
code_anaylsis:
22
23
24
    only:
        - master
        - merge_requests
Thomas Beermann's avatar
Thomas Beermann committed
25
26
        - branches
        - tags
27
28
    stage: code_quality_analysis
    script: "mvn -P sonar clean verify sonar:sonar"
29
    allow_failure: true
femiadeyemi's avatar
femiadeyemi committed
30

31
deploy:
32
33
34
    only:
        - master
        - merge_requests
Thomas Beermann's avatar
Thomas Beermann committed
35
        - tags
36
    stage: deploy
37
    script:
Thomas Beermann's avatar
Thomas Beermann committed
38
        - |
Thomas Beermann's avatar
Thomas Beermann committed
39
            if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ]]; then
Thomas Beermann's avatar
Thomas Beermann committed
40
41
                WEBAPP_PROJECT_BRANCH=".$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
                echo "WEBAPP_PROJECT_BRANCH=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" >> build.env
Thomas Beermann's avatar
Thomas Beermann committed
42
43
            elif [[ -n "$CI_COMMIT_TAG" ]]; then
                WEBAPP_PROJECT_VERSION=$CI_COMMIT_TAG
Thomas Beermann's avatar
Thomas Beermann committed
44
            fi
Thomas Beermann's avatar
Thomas Beermann committed
45
            echo "WEBAPP_PROJECT_VERSION=$WEBAPP_PROJECT_VERSION" >> build.env
46
        - mvn $MAVEN_CLI_OPTS deploy
Thomas Beermann's avatar
Thomas Beermann committed
47
48
49
    artifacts:
      reports:
        dotenv: build.env
50

51
trigger:
52
53
54
    only:
        - master
        - merge_requests
Thomas Beermann's avatar
Thomas Beermann committed
55
        - tags
56
57
    variables:
        WEBAPP_VERSION: $WEBAPP_PROJECT_VERSION
Thomas Beermann's avatar
Thomas Beermann committed
58
        WEBAPP_BRANCH: $WEBAPP_PROJECT_BRANCH
59
60
    stage: trigger_marketplace_server
    trigger: hifis-technical-platform/helmholtz-marketplace-server