.gitlab-ci.yml 2.92 KB
Newer Older
1 2 3 4 5 6 7 8 9
variables:
  DEBIAN_FRONTEND: noninteractive
  LC_ALL: C.UTF-8
  GIT_STRATEGY: fetch

stages:
  - configure
  - build
  - test
10
  - deploy
11

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
.freebsd_i386: &freebsd_i386
  tags:
    - freebsd
    - i386
  only:
    - master
    - triggers
    - tags

.freebsd_amd64: &freebsd_amd64
  tags:
    - freebsd
    - amd64
  only:
    - master
    - triggers
    - tags

30
.debian_stretch: &debian_stretch
31
  image: cznic/debian:stretch-knot-latest
32 33 34 35
  tags:
    - docker
    - linux
    - amd64
36

37
.ubuntu_xenial: &ubuntu_xenial
38 39 40 41 42 43 44 45 46 47 48 49 50
  image: cznic/ubuntu:16.04-knot
  tags:
    - docker
    - linux
    - amd64

.configure: &configure_job
  stage: configure
  script:
    - autoreconf -fi
    - ./configure --disable-fastparser
  artifacts:
    untracked: true
51
    expire_in: '1 hour'
52 53 54 55 56 57 58

.build: &build_job
  stage: build
  script:
    - make -k all
  artifacts:
    untracked: true
59
    expire_in: '1 hour'
60 61 62 63 64 65

.test: &test_job
  stage: test
  script:
    - make -k check

66

67
configure:ubuntu:amd64:
68
  <<: *ubuntu_xenial
69 70 71
  <<: *configure_job

build:ubuntu:amd64:
72
  <<: *ubuntu_xenial
73 74 75 76 77
  <<: *build_job
  dependencies:
    - configure:ubuntu:amd64

test:ubuntu:amd64:
78
  <<: *ubuntu_xenial
79 80 81
  <<: *test_job
  dependencies:
    - build:ubuntu:amd64
82

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

configure:debian:stretch:amd64:
  <<: *debian_stretch
  <<: *configure_job

build:debian:stretch:amd64:
  <<: *debian_stretch
  <<: *build_job
  dependencies:
    - configure:debian:stretch:amd64

test:debian:stretch:amd64:
  <<: *debian_stretch
  <<: *test_job
  dependencies:
    - build:debian:stretch:amd64

Ondřej Surý's avatar
Ondřej Surý committed
100

101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
configure:freebsd:i386:
  <<: *freebsd_i386
  <<: *configure_job

build:freebsd:i386:
  <<: *freebsd_i386
  <<: *build_job
  dependencies:
    - configure:freebsd:i386

test:freebsd:i386:
  <<: *freebsd_i386
  <<: *test_job
  dependencies:
    - build:freebsd:i386

117

118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
configure:freebsd:amd64:
  <<: *freebsd_amd64
  <<: *configure_job

build:freebsd:amd64:
  <<: *freebsd_amd64
  <<: *build_job
  dependencies:
    - configure:freebsd:amd64

test:freebsd:amd64:
  <<: *freebsd_amd64
  <<: *test_job
  dependencies:
    - build:freebsd:amd64
133 134


135 136
build:documentation:
  <<: *debian_stretch
137
  stage: build
138 139 140 141 142 143 144 145 146
  dependencies:
    - configure:debian:stretch:amd64
  only:
    - tags
    - triggers
  script:
    - make -C doc html singlehtml pdf
  artifacts:
    paths:
147 148 149
      - doc/_build/html/
      - doc/_build/singlehtml/
      - doc/_build/latex/knot.pdf
150
    expire_in: '1 hour'
151 152 153

deploy:documentation:
  <<: *debian_stretch
154
  stage: deploy
155 156
  dependencies:
    - build:documentation
157 158 159 160
  only:
    - tags
    - triggers
  script:
161 162 163 164
    - "curl --http1.1 --request POST --form token=$WEBSITE_TOKEN --form ref=master
      --form \"variables[RELEASE_CI_BUILD_REF_NAME]=$CI_COMMIT_REF_NAME\"
      --form \"variables[RELEASE_CI_BUILD_ID]=$CI_JOB_ID\"
      https://gitlab.labs.nic.cz/api/v3/projects/5/trigger/builds"
165
  artifacts:
166
    name: "knot-dns-$CI_COMMIT_REF_NAME-doc"
167
    paths:
168 169 170
      - doc/_build/html/
      - doc/_build/singlehtml/
      - doc/_build/latex/knot.pdf