.gitlab-ci.yml 2.91 KB
Newer Older
Markus Frosch's avatar
Markus Frosch committed
1 2 3 4 5 6 7
stages:
  - build
  - test
  - upload

variables:
  DOCKER_IMAGE_BASE: registry.icinga.com/build-docker
Henrik Triem's avatar
Henrik Triem committed
8 9
  ICINGA_BUILD_TYPE: snapshot
  #ICINGA_BUILD_TYPE: release
Markus Frosch's avatar
Markus Frosch committed
10
  #ICINGA_BUILD_RELEASE_TYPE:
Markus Frosch's avatar
Markus Frosch committed
11
  #ICINGA_BUILD_UPSTREAM_BRANCH:
Markus Frosch's avatar
Markus Frosch committed
12 13 14 15 16 17 18 19 20 21 22 23

.build: &build
  stage: build
  tags:
    - docker
  image: ${DOCKER_IMAGE_BASE}/${DOCKER_IMAGE}
  script:
    - icinga-build-package
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - ccache/
24
      - 'icinga2.git'
Markus Frosch's avatar
Markus Frosch committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
  artifacts:
    paths:
      - build/*
    expire_in: 1 week

.test: &test
  stage: test
  tags:
    - docker
  image: ${DOCKER_IMAGE_BASE}/${DOCKER_IMAGE}
  script:
    - find build/
    - icinga-build-test

.upload: &upload
  stage: upload
  tags:
    - docker
  image: ${DOCKER_IMAGE_BASE}/upload
  script:
    - find build/
    - icinga-build-upload-aptly
47
  only:
Markus Frosch's avatar
Markus Frosch committed
48 49
    - master
    - tags
Markus Frosch's avatar
Markus Frosch committed
50

Markus Frosch's avatar
Markus Frosch committed
51 52 53
###################################
# EPEL
###################################
Markus Frosch's avatar
Markus Frosch committed
54
build/centos/8:
Markus Frosch's avatar
Markus Frosch committed
55 56
  <<: *build
  variables:
Markus Frosch's avatar
Markus Frosch committed
57
    DOCKER_IMAGE: centos/8
Markus Frosch's avatar
Markus Frosch committed
58

Markus Frosch's avatar
Markus Frosch committed
59
test/centos/8:
Markus Frosch's avatar
Markus Frosch committed
60 61
  <<: *test
  variables:
Markus Frosch's avatar
Markus Frosch committed
62
    DOCKER_IMAGE: centos/8
Markus Frosch's avatar
Markus Frosch committed
63
  dependencies:
Markus Frosch's avatar
Markus Frosch committed
64
    - build/centos/8
Markus Frosch's avatar
Markus Frosch committed
65 66 67 68

upload/epel/8:
  <<: *upload
  dependencies:
Markus Frosch's avatar
Markus Frosch committed
69
    - build/centos/8
Markus Frosch's avatar
Markus Frosch committed
70

Markus Frosch's avatar
Markus Frosch committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
build/centos/7:
  <<: *build
  variables:
    DOCKER_IMAGE: centos/7

test/centos/7:
  <<: *test
  variables:
    DOCKER_IMAGE: centos/7
  dependencies:
    - build/centos/7

upload/epel/7:
  <<: *upload
  dependencies:
    - build/centos/7
Markus Frosch's avatar
Markus Frosch committed
87

Markus Frosch's avatar
Markus Frosch committed
88 89 90
###################################
# Fedora
###################################
Alexander A. Klimov's avatar
Alexander A. Klimov committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
build/fedora/34:
  <<: *build
  variables:
    DOCKER_IMAGE: fedora/34
    RPM_BUILD_NCPUS: '1'

test/fedora/34:
  <<: *test
  variables:
    DOCKER_IMAGE: fedora/34
  dependencies:
    - build/fedora/34

upload/fedora/34:
  <<: *upload
  dependencies:
    - build/fedora/34

Alexander A. Klimov's avatar
Alexander A. Klimov committed
109 110 111 112
build/fedora/33:
  <<: *build
  variables:
    DOCKER_IMAGE: fedora/33
113
    RPM_BUILD_NCPUS: '1'
Alexander A. Klimov's avatar
Alexander A. Klimov committed
114 115 116 117 118 119 120 121 122 123 124 125 126

test/fedora/33:
  <<: *test
  variables:
    DOCKER_IMAGE: fedora/33
  dependencies:
    - build/fedora/33

upload/fedora/33:
  <<: *upload
  dependencies:
    - build/fedora/33

Markus Frosch's avatar
Markus Frosch committed
127 128 129
###################################
# SLES
###################################
Noah Hilverling's avatar
Noah Hilverling committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
build/sles/15.2:
  <<: *build
  variables:
    DOCKER_IMAGE: sles/15.2

test/sles/15.2:
  <<: *test
  variables:
    DOCKER_IMAGE: sles/15.2
  dependencies:
    - build/sles/15.2

upload/SUSE/15.2:
  <<: *upload
  dependencies:
    - build/sles/15.2

Henrik Triem's avatar
Henrik Triem committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
build/sles/12.5:
  <<: *build
  variables:
    DOCKER_IMAGE: sles/12.5

test/sles/12.5:
  <<: *test
  variables:
    DOCKER_IMAGE: sles/12.5
  dependencies:
    - build/sles/12.5

upload/SUSE/12.5:
  <<: *upload
  dependencies:
    - build/sles/12.5

Markus Frosch's avatar
Markus Frosch committed
164 165 166
###################################
# openSUSE
###################################
Alexander A. Klimov's avatar
Alexander A. Klimov committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
build/opensuse/15.2:
  <<: *build
  variables:
    DOCKER_IMAGE: opensuse/15.2

test/opensuse/15.2:
  <<: *test
  variables:
    DOCKER_IMAGE: opensuse/15.2
  dependencies:
    - build/opensuse/15.2

upload/openSUSE/15.2:
  <<: *upload
  dependencies:
    - build/opensuse/15.2