.gitlab-ci.yml 2.1 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
Markus Mirz's avatar
Markus Mirz committed
10
  - deploy
11
12
13
14

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

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

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

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

69
deploy:docs:
Markus Mirz's avatar
Markus Mirz committed
70
71
  stage: deploy
  script:
72
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/doc/${CI_BUILD_REF_NAME}/{sphinx,doxygen}
73
74
    - 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
75
76
77
78
79
80
81
82
  dependencies:
    - build:docs
  only:
    - tags
    - master
    - development
  tags:
    - fein-deploy
Markus Mirz's avatar
Markus Mirz committed
83
84
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

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