Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

.gitlab-ci.yml 2.75 KB
Newer Older
1
variables:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
2
  DOCKER_TAG_DEV: ${CI_COMMIT_REF_NAME}
3
  RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER}
Markus Mirz's avatar
Markus Mirz committed
4
  DOCKER_IMAGE_DEV: dpsim-dev
5
6
7
8
9
10
11
12
13

before_script:
  - git submodule sync --recursive
  - git submodule update --init
      Examples/Results
      Dependencies/libcps
      Dependencies/libcps/Dependencies/eigen
      Dependencies/libcps/Dependencies/libcimpp
      Dependencies/libcps/Dependencies/libcimpp/thirdparty/arabica
14

15
16
stages:
  - prepare
Steffen Vogel's avatar
Steffen Vogel committed
17
  - pre-build
18
  - build
Steffen Vogel's avatar
Steffen Vogel committed
19
  - test
Markus Mirz's avatar
Markus Mirz committed
20
  - deploy
21
22
23
24

docker:
  stage: prepare
  script:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
25
    - docker build -t ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} .
Markus Mirz's avatar
Markus Mirz committed
26
    - docker images
27
  tags:
Markus Mirz's avatar
Markus Mirz committed
28
    - shell
29

30
build:code:
Steffen Vogel's avatar
Steffen Vogel committed
31
  stage: pre-build
32
  script:
Markus Mirz's avatar
Markus Mirz committed
33
34
    - mkdir build
    - cd build
Georg Martin Reinke's avatar
fix CI    
Georg Martin Reinke committed
35
    - cmake ..
Markus Mirz's avatar
Markus Mirz committed
36
    - make -j 8
Markus Mirz's avatar
Markus Mirz committed
37
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
38
39
  artifacts:
    paths:
Markus Mirz's avatar
Markus Mirz committed
40
      - build
41
  tags:
Georg Martin Reinke's avatar
Georg Martin Reinke committed
42
43
    - docker

44
45
46
47
48
49
50
51
52
53
54
55
56
build:win32:
  stage: pre-build
  script:
    - mkdir build
    - cd build
    - cmake -G "Visual Studio 15 2017 Win64" ..
    - cmake --build .
  artifacts:
    paths:
      - build
  tags:
    - windows

57
58
build:docs:
  stage: build
Georg Martin Reinke's avatar
Georg Martin Reinke committed
59
  script:
Steffen Vogel's avatar
Steffen Vogel committed
60
61
    - make -C build docs
    - make -C build docs_cxx
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
62
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
Steffen Vogel's avatar
Steffen Vogel committed
63
64
  dependencies:
    - build:code
Georg Martin Reinke's avatar
Georg Martin Reinke committed
65
66
  artifacts:
    paths:
Markus Mirz's avatar
Markus Mirz committed
67
68
      - build/Documentation/html
      - build/Documentation/Cxx/html
Georg Martin Reinke's avatar
Georg Martin Reinke committed
69
70
  tags:
    - docker
71

Steffen Vogel's avatar
Steffen Vogel committed
72
73
74
build:packages:
  stage: build
  script:
Steffen Vogel's avatar
Steffen Vogel committed
75
    - make -C build package
Steffen Vogel's avatar
Steffen Vogel committed
76
77
78
79
80
  only:
    - tags
  tags:
    - docker
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
Steffen Vogel's avatar
Steffen Vogel committed
81
82
  dependencies:
    - build:code
Steffen Vogel's avatar
Steffen Vogel committed
83
84
85
86
87
  artifacts:
    paths:
      - build/*.rpm
      - build/*.tar.gz

88
test:pytest:
Steffen Vogel's avatar
Steffen Vogel committed
89
90
91
  stage: test
  script:
    - make -C build install
92
    - pytest -v
Steffen Vogel's avatar
Steffen Vogel committed
93
94
95
96
97
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
  dependencies:
    - build:code
  artifacts:
    paths:
98
      - Logs/
Steffen Vogel's avatar
Steffen Vogel committed
99
100
101
  tags:
    - docker

102
deploy:docs:
Markus Mirz's avatar
Markus Mirz committed
103
104
  stage: deploy
  script:
105
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/{sphinx,doxygen}
106
107
    - rsync ${RSYNC_OPTS} --delete build/Documentation/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/sphinx
    - rsync ${RSYNC_OPTS} --delete build/Documentation/Cxx/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/doxygen
108
109
110
111
112
113
114
115
  dependencies:
    - build:docs
  only:
    - tags
    - master
    - development
  tags:
    - fein-deploy
Markus Mirz's avatar
Markus Mirz committed
116
117
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

deploy:packages:
  stage: deploy
  script:
    - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/packages/redhat/x86_64
    - rsync ${RSYNC_OPTS} build/*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/dpsim/src
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo /var/www/packages/redhat
  dependencies:
    - build:packages
  only:
    - tags
  tags:
    - fein-deploy
  tags:
    - shell