.gitlab-ci.yml 2.24 KB
Newer Older
Markus Frosch's avatar
Markus Frosch committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
stages:
  - build
  - test
#  - upload

variables:
  DOCKER_IMAGE_BASE: registry.icinga.com/build-docker
  ICINGA_BUILD_TYPE: snapshot
  # all builds use the stretch data as of now
  ICINGA_BUILD_DEB_FLAVOR: stretch

.build: &build
  stage: build
  tags:
    - docker
  image: ${DOCKER_IMAGE_BASE}/${DOCKER_IMAGE}
  before_script:
    - echo "machine git.icinga.com login ${ICINGA_GITLAB_USER} password ${ICINGA_GITLAB_TOKEN}" >> $HOME/.netrc
  script:
    # TODO: remove when merged
    - '[ "$(date +%s)" -gt 1538344800 ] || export ICINGA_BUILD_UPSTREAM_BRANCH=mfrosch/packaging'
    - icinga-build-package
  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:
#     - icinga-build-upload-aptly --result build/ --target $UPLOAD_TARGET --release $UPLOAD_RELEASE --insecure
#   only:
#     - tags

build debian stretch x86:
  variables:
    DOCKER_IMAGE: debian/stretch:x86
  <<: *build

test debian stretch x86:
  variables:
    DOCKER_IMAGE: debian/stretch:x86
  dependencies:
    - build debian stretch x86
  <<: *test

build debian stretch:
  variables:
    DOCKER_IMAGE: debian/stretch:x86_64
  <<: *build

test debian stretch:
  variables:
    DOCKER_IMAGE: debian/stretch:x86_64
  dependencies:
    - build debian stretch
  <<: *test

# upload debian stretch:
#   variables:
#     UPLOAD_TARGET: stack/debian
#     UPLOAD_RELEASE: icinga-stretch
#   dependencies:
#     - build debian stretch
#   <<: *upload

build ubuntu bionic x86:
  variables:
    DOCKER_IMAGE: ubuntu/bionic:x86
  <<: *build

test ubuntu bionic x86:
  variables:
    DOCKER_IMAGE: ubuntu/bionic:x86
  dependencies:
    - build ubuntu bionic x86
  <<: *test

build ubuntu bionic:
  variables:
    DOCKER_IMAGE: ubuntu/bionic:x86_64
  <<: *build

test ubuntu bionic:
  variables:
    DOCKER_IMAGE: ubuntu/bionic:x86_64
  dependencies:
    - build ubuntu bionic
  <<: *test

# upload ubuntu bionic:
#   variables:
#     UPLOAD_TARGET: stack/ubuntu
#     UPLOAD_RELEASE: icinga-bionic
#   dependencies:
#     - build ubuntu bionic
#   <<: *upload