.gitlab-ci.yml 2.36 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
9
stages:
  - prepare
  - build
Steffen Vogel's avatar
Steffen Vogel committed
10
  - test
Markus Mirz's avatar
Markus Mirz committed
11
  - deploy
12
13
14
15

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

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

35
36
build:docs:
  stage: build
Georg Martin Reinke's avatar
Georg Martin Reinke committed
37
  script:
Steffen Vogel's avatar
Steffen Vogel committed
38
    - mkdir build
Markus Mirz's avatar
Markus Mirz committed
39
    - cd build
Markus Mirz's avatar
Markus Mirz committed
40
    - cmake ..
41
    - make docs
Markus Mirz's avatar
Markus Mirz committed
42
    - make docs_cxx
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
43
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
Georg Martin Reinke's avatar
Georg Martin Reinke committed
44
45
  artifacts:
    paths:
Markus Mirz's avatar
Markus Mirz committed
46
47
      - build/Documentation/html
      - build/Documentation/Cxx/html
Georg Martin Reinke's avatar
Georg Martin Reinke committed
48
49
  tags:
    - docker
50

Steffen Vogel's avatar
Steffen Vogel committed
51
52
53
54
55
56
build:packages:
  stage: build
  script:
    - mkdir build
    - cd build
    - cmake ..
Steffen Vogel's avatar
Steffen Vogel committed
57
    - make package
Steffen Vogel's avatar
Steffen Vogel committed
58
59
60
61
62
63
64
65
66
67
68
69
  only:
    - development
    - master
    - tags
  tags:
    - docker
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
  artifacts:
    paths:
      - build/*.rpm
      - build/*.tar.gz

Steffen Vogel's avatar
Steffen Vogel committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
test:python:
  stage: test
  script:
    - make -C build install
    - python3 Examples/Python/ci.py
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
  dependencies:
    - build:code
  artifacts:
    paths:
      - Examples/Python/*.csv
  tags:
    - docker

84
deploy:docs:
Markus Mirz's avatar
Markus Mirz committed
85
86
  stage: deploy
  script:
87
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/{sphinx,doxygen}
88
89
    - rsync ${RSYNC_OPTS} build/Documentation/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/$CI_BUILD_REF_NAME/sphinx
    - rsync ${RSYNC_OPTS} build/Documentation/Cxx/html/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/doc/$CI_BUILD_REF_NAME/doxygen
90
91
92
93
94
95
96
97
  dependencies:
    - build:docs
  only:
    - tags
    - master
    - development
  tags:
    - fein-deploy
Markus Mirz's avatar
Markus Mirz committed
98
99
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

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
    - master
    - development
  tags:
    - fein-deploy
  tags:
    - shell