.gitlab-ci.yml 2.79 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
.debian_stretch: &debian_stretch
13
  image: cznic/debian:stretch-knot-v2
14 15 16 17 18 19
  tags:
    - docker
    - linux
    - amd64
  
.ubuntu_xenial: &ubuntu_xenial
20 21 22 23 24 25
  image: cznic/ubuntu:16.04-knot
  tags:
    - docker
    - linux
    - amd64

Ondřej Surý's avatar
Ondřej Surý committed
26 27 28 29 30 31 32
.debian_stretch_armel: &debian_stretch_armel
  image: cznic/armel-debian-knot
  tags:
    - docker
    - linux
    - arm

33 34 35 36 37 38 39
.configure: &configure_job
  stage: configure
  script:
    - autoreconf -fi
    - ./configure --disable-fastparser
  artifacts:
    untracked: true
40
    expire_in: '1 hour'
41 42 43 44 45 46 47

.build: &build_job
  stage: build
  script:
    - make -k all
  artifacts:
    untracked: true
48
    expire_in: '1 hour'
49 50 51 52 53 54 55

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

configure:ubuntu:amd64:
56
  <<: *ubuntu_xenial
57
  <<: *configure_job
58 59
  except:
    - tags
60
    - docs-*
61 62

build:ubuntu:amd64:
63
  <<: *ubuntu_xenial
64 65 66
  <<: *build_job
  dependencies:
    - configure:ubuntu:amd64
67 68
  except:
    - tags
69
    - docs-*
70 71

test:ubuntu:amd64:
72
  <<: *ubuntu_xenial
73 74 75
  <<: *test_job
  dependencies:
    - build:ubuntu:amd64
76 77
  except:
    - tags
78
    - docs-*
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

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
96 97 98
configure:debian:stretch:armel:
  <<: *debian_stretch_armel
  <<: *configure_job
99 100
  only:
    - triggers
Ondřej Surý's avatar
Ondřej Surý committed
101 102 103 104 105 106

build:debian:stretch:armel:
  <<: *debian_stretch_armel
  <<: *build_job
  dependencies:
    - configure:debian:stretch:armel
107 108
  only:
    - triggers
Ondřej Surý's avatar
Ondřej Surý committed
109 110 111 112 113 114

test:debian:stretch:armel:
  <<: *debian_stretch_armel
  <<: *test_job
  dependencies:
    - build:debian:stretch:armel
115 116
  only:
    - triggers
Ondřej Surý's avatar
Ondřej Surý committed
117

118 119
build:documentation:
  <<: *debian_stretch
120
  stage: build
121 122 123 124 125
  dependencies:
    - configure:debian:stretch:amd64
  only:
    - tags
    - triggers
126
    - docs-*
127 128 129 130
  script:
    - make -C doc html singlehtml pdf
  artifacts:
    paths:
131 132 133
      - doc/_build/html/
      - doc/_build/singlehtml/
      - doc/_build/latex/knot.pdf
134
    expire_in: '1 hour'
135 136 137

deploy:documentation:
  <<: *debian_stretch
138
  stage: deploy
139 140
  before_script:
    - apt-get -y install curl
141 142 143
  only:
    - tags
    - triggers
144
    - docs-*
145
  script:
146
    - "curl --http1.1 --request POST --form token=$WEBSITE_TOKEN --form ref=master --form \"variables[RELEASE_CI_BUILD_REF_NAME]=$CI_BUILD_REF_NAME\" --form \"variables[RELEASE_CI_BUILD_ID]=$CI_BUILD_ID\" https://gitlab.labs.nic.cz/api/v3/projects/5/trigger/builds"
147
  artifacts:
148
    name: "knot-dns-$CI_BUILD_REF_NAME-doc"
149
    paths:
150 151 152
      - doc/_build/html/
      - doc/_build/singlehtml/
      - doc/_build/latex/knot.pdf