.gitlab-ci.yml 2.5 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
  GIT_SUBMODULE_STRATEGY: recursive
6

7
8
stages:
  - prepare
Steffen Vogel's avatar
Steffen Vogel committed
9
  - pre-build
10
  - build
Steffen Vogel's avatar
Steffen Vogel committed
11
  - test
Markus Mirz's avatar
Markus Mirz committed
12
  - deploy
13
14
15
16

docker:
  stage: prepare
  script:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
17
    - docker build -t ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} .
Markus Mirz's avatar
Markus Mirz committed
18
    - docker images
19
  tags:
Markus Mirz's avatar
Markus Mirz committed
20
    - shell
21

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

36
37
38
39
40
41
42
43
44
45
46
47
48
build:win32:
  stage: pre-build
  script:
    - mkdir build
    - cd build
    - cmake -G "Visual Studio 15 2017 Win64" ..
    - cmake --build .
  artifacts:
    paths:
      - build
  tags:
    - windows

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

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

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

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

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