.gitlab-ci.yml 2.71 KB
Newer Older
Jean Meurice's avatar
Jean Meurice committed
1 2 3 4 5 6 7
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#

ham's avatar
ham committed
8

Evgeny Kusmenko's avatar
Evgeny Kusmenko committed
9 10 11
image: maven:3-jdk-8

stages:
Evgeny Kusmenko's avatar
Evgeny Kusmenko committed
12
- windows
hengwen's avatar
Fix yml  
hengwen committed
13
- linux
Evgeny Kusmenko's avatar
Evgeny Kusmenko committed
14

Pascal Maurice Porta's avatar
Pascal Maurice Porta committed
15
masterJobWindowsRpc:
Christoph von Oy's avatar
Christoph von Oy committed
16 17
  stage: windows
  script:
Pascal Maurice Porta's avatar
Pascal Maurice Porta committed
18 19
  - cd rpc
  - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B  clean deploy --settings ..\settings.xml
hengwen's avatar
hengwen committed
20
  - mvn package sonar:sonar --settings ..\settings.xml -DskipTests
Pascal Maurice Porta's avatar
Pascal Maurice Porta committed
21 22 23 24 25 26 27 28 29 30 31
  tags:
  - Windows10
  only:
  - master
  
masterJobWindowsRestful:
  stage: windows
  script:
  - cd restful
  # TODO: we have to skip tests for now, because most tests require a running instance of zookeeper
  - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B  clean deploy --settings ..\settings.xml -DskipTests
hengwen's avatar
hengwen committed
32
  - mvn package sonar:sonar --settings ..\settings.xml -DskipTests
Christoph von Oy's avatar
Christoph von Oy committed
33 34
  tags:
  - Windows10
Evgeny Kusmenko's avatar
Evgeny Kusmenko committed
35 36 37
  only:
  - master

hengwen's avatar
Testing  
hengwen committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#branchJobWindowsRpc:
#  stage: windows
#  script:
#  - cd rpc
#  - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B  clean install --settings ..\settings.xml
#  tags:
#  - Windows10
#  except:
#  - master
#
#branchJobWindowsRestful:
#  stage: windows
#  script:
#    - cd restful
#    # TODO: we have to skip tests for now, because most tests require a running instance of zookeeper
#    - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B  clean install --settings ..\settings.xml -DskipTests
#  tags:
#    - Windows10
#  except:
#    - master
58

hengwen's avatar
hengwen committed
59
# run tests
hengwen's avatar
hengwen committed
60
branchJobLinux:
hengwen's avatar
hengwen committed
61 62 63
  tags:
    - docker
  stage: linux
hengwen's avatar
hengwen committed
64 65
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
hengwen's avatar
hengwen committed
66
  script:
hengwen's avatar
hengwen committed
67 68 69
    # cleanup
    - docker rm $(docker ps -qa --no-trunc --filter "status=exited")
    - docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')
hengwen's avatar
hengwen committed
70 71
    # pull the latest RMIServer image
    - docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
hengwen's avatar
hengwen committed
72 73 74 75 76 77 78 79
    - cd docker
    - ./build.sh
    - ./run_test.sh
  except:
    - master

# build, test and publish docker images
masterJobLinux:
hengwen's avatar
hengwen committed
80 81 82 83 84 85
  tags:
    - docker
  stage: linux
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
hengwen's avatar
hengwen committed
86 87
    # pull the latest RMIServer image
    - docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
hengwen's avatar
hengwen committed
88 89 90 91 92 93 94
    - cd docker
    - ./build.sh
    - ./run_test.sh
    - docker tag rpc-server:latest $CI_REGISTRY_IMAGE:rpc
    - docker tag restful-server:latest $CI_REGISTRY_IMAGE:restful
    - docker push $CI_REGISTRY_IMAGE:rpc
    - docker push $CI_REGISTRY_IMAGE:restful
hengwen's avatar
hengwen committed
95
  only:
hengwen's avatar
hengwen committed
96
    - master