.gitlab-ci.yml 2.64 KB
Newer Older
1
image: git.fortiss.org:5001/af3/maven-releng:latest
2
3

stages:
4
  - clean
5
6
  - build
  - test
7
  - deploy
8
9

variables:
10
11
12
  # recursive should work here, but gitlab-runner does not pull the latest remote
  # for submodules: https://gitlab.com/gitlab-org/gitlab-runner/issues/3011
  GIT_SUBMODULE_STRATEGY: none
13
  GIT_SUBMODULE_OPTS: "--remote --recursive --init --recommend-shallow --force"
14
  MAVEN_CLI_OPTS: "--batch-mode"
Alexander Diewald's avatar
Caching    
Alexander Diewald committed
15
  MAVEN_OPTS: "-Dmaven.repo.local=/cache/maven.repository"
16
  MAVEN_BUILD_OPTS: "-Dbuild.tooling=true -Dbuild.af3=true -Dbuild.emf=true"
Alexander Diewald's avatar
Alexander Diewald committed
17
  MAVEN_TEST_OPTS: "-Dbuild.tests=true"
Alexander Diewald's avatar
Alexander Diewald committed
18
  MAVEN_BUILD_DIR: "-Duser.dir=/builds/$CI_PROJECT_PATH"
19

20
21
22
23
24
25
26
27
28
29
30
clean:
  stage: clean
  cache:
    key: Default
  rules:
    - if: '$BUILD_TYPE == "clean"' # This rule will be evaluated
      when: on_success
  before_script:
    - git submodule update $GIT_SUBMODULE_OPTS
  script:
    - mvn $MAVEN_CLI_OPTS $MAVEN_BUILD_OPTS clean
31

32
33
build:
  stage: build
Alexander Diewald's avatar
Alexander Diewald committed
34
35
  cache:
    key: Default
36
  before_script:
Alexander Diewald's avatar
Alexander Diewald committed
37
    - git submodule update $GIT_SUBMODULE_OPTS
38
  script:
39
    - mvn $MAVEN_CLI_OPTS $MAVEN_BUILD_OPTS verify
40
  artifacts:
41
    untracked: true
42
43
    paths:
      - releng/org.fortiss.af3.update/target/repository/
44
      - releng/org.fortiss.tooling.update/target/repository/
45
      - products/af3/org.fortiss.af3.phoenix.product/target/products/org.fortiss.af3.phoenix.product-*.zip
46
47
48

test:
  stage: test
49
50
  dependencies: 
    - build
Alexander Diewald's avatar
Alexander Diewald committed
51
52
  cache:
    key: Default
53
  before_script:
54
55
56
57
    - git submodule update $GIT_SUBMODULE_OPTS releng/org.fortiss.af3.target
    - git submodule update $GIT_SUBMODULE_OPTS tests/af3
    - git submodule update $GIT_SUBMODULE_OPTS features/af3
    - git submodule update $GIT_SUBMODULE_OPTS features/tooling
Alexander Diewald's avatar
Alexander Diewald committed
58
    - xvfb.sh # Setup of a virtual display needed for bringing up eclipse
59
  script:
Alexander Diewald's avatar
Alexander Diewald committed
60
    - mvn $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS $MAVEN_BUILD_DIR integration-test
61
62
63
  artifacts:
    paths:
      - tests/af3/org.fortiss.af3.phoenix.product.tests/target/surefire-reports/TEST-org.fortiss.af3.phoenix.product.tests.AllTests.xml
64
      - products/af3/org.fortiss.af3.phoenix.product/target/products/org.fortiss.af3.phoenix.product-*.zip
65
66
67
68
69

deploy:
  stage: deploy
  dependencies:
    - test
Alexander Diewald's avatar
Alexander Diewald committed
70
71
72
  rules:
    - if: '$BUILD_TYPE == "nightly"' # This rule will be evaluated
      when: on_success
73
74
  script:
    - ls
75
76
77
78
  artifacts:
    paths:
      - products/af3/org.fortiss.af3.phoenix.product/target/products/org.fortiss.af3.phoenix.product-linux.gtk.x86_64.zip
      - products/af3/org.fortiss.af3.phoenix.product/target/products/org.fortiss.af3.phoenix.product-macosx.cocoa.x86_64.zip
Alexander Diewald's avatar
Alexander Diewald committed
79
      - products/af3/org.fortiss.af3.phoenix.product/target/products/org.fortiss.af3.phoenix.product-win32.win32.x86_64.zip