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.6 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

before_script:
7
  - git config --system core.longpaths true
8
  - git submodule sync --recursive
9
  - git submodule update --init --recursive
10

11
12
stages:
  - prepare
Steffen Vogel's avatar
Steffen Vogel committed
13
  - pre-build
14
  - build
Steffen Vogel's avatar
Steffen Vogel committed
15
  - test
Markus Mirz's avatar
Markus Mirz committed
16
  - deploy
17
18
19
20

docker:
  stage: prepare
  script:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
21
    - docker build -t ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} .
Markus Mirz's avatar
Markus Mirz committed
22
    - docker images
23
  tags:
Markus Mirz's avatar
Markus Mirz committed
24
    - shell
25

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

40
41
42
43
44
45
46
47
48
49
50
51
52
build:win32:
  stage: pre-build
  script:
    - mkdir build
    - cd build
    - cmake -G "Visual Studio 15 2017 Win64" ..
    - cmake --build .
  artifacts:
    paths:
      - build
  tags:
    - windows

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

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

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

98
deploy:docs:
Markus Mirz's avatar
Markus Mirz committed
99
100
  stage: deploy
  script:
101
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/{sphinx,doxygen}
102
103
    - 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
104
105
106
107
108
109
110
111
  dependencies:
    - build:docs
  only:
    - tags
    - master
    - development
  tags:
    - fein-deploy
Markus Mirz's avatar
Markus Mirz committed
112
113
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

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