.gitlab-ci.yml 1.4 KB
Newer Older
R
Renaud Gaubert 已提交
1 2 3 4
image: docker:latest

services:
  - docker:dind
R
Renaud Gaubert 已提交
5 6

stages:
7
  - build
8 9 10 11
  - test

variables:
  RUNTIMEGOPATH: "/go/src/gitlab.com/nvidia/container-toolkit/nvidia-container-runtime"
12

R
Renaud Gaubert 已提交
13 14
.build_template: &build_definition
  stage: build
R
Renaud Gaubert 已提交
15
  script:
R
Renaud Gaubert 已提交
16 17 18
    - OS="${CI_JOB_NAME#*:}"
    - apk add make

R
Renaud Gaubert 已提交
19
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
R
Renaud Gaubert 已提交
20 21
    - make REGISTRY=${CI_REGISTRY_IMAGE} pull${OS}
    - make REGISTRY=${CI_REGISTRY_IMAGE} ${OS}
R
Renaud Gaubert 已提交
22 23 24 25 26
    - make REGISTRY=${CI_REGISTRY_IMAGE} push${OS}
  artifacts:
    expire_in: 1 week
    paths:
      - dist/
R
Renaud Gaubert 已提交
27

R
Renaud Gaubert 已提交
28 29
amd64:amzn1:
  <<: *build_definition
30

R
Renaud Gaubert 已提交
31 32
amd64:amzn2:
  <<: *build_definition
33

R
Renaud Gaubert 已提交
34 35
amd64:centos7:
  <<: *build_definition
36

R
Renaud Gaubert 已提交
37 38
amd64:opensuse-leap15.1:
  <<: *build_definition
39

R
Renaud Gaubert 已提交
40 41
amd64:debian9:
  <<: *build_definition
42

R
Renaud Gaubert 已提交
43 44 45 46 47 48 49 50
amd64:debian10:
  <<: *build_definition

amd64:ubuntu16.04:
  <<: *build_definition

amd64:ubuntu18.04:
  <<: *build_definition
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

unit-tests:
  stage: test
  image: ${CI_REGISTRY_IMAGE}/runtime/ubuntu18.04
  script:
    - cd ${RUNTIMEGOPATH}
    - make verify

shim-tests:
  stage: test
  image: ${CI_REGISTRY_IMAGE}/runtime/ubuntu18.04
  script:
    - mkdir /etc/nvidia-container-runtime && echo "" > /etc/nvidia-container-runtime/config.toml # config for test
    - echo "" > /usr/bin/nvidia-container-runtime-hook # hook for test
    - chmod +x /usr/bin/nvidia-container-runtime-hook

    - cd ${RUNTIMEGOPATH}
    - make test