aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 1ab02fe2c0c4115f906bd6c966a9a5dbaebcb47d (plain)
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
# NFVBench Gitlab-CI Jobs
---
include:
  - project: anuket/releng
    file: '/gitlab-templates/RTD.gitlab-ci.yml'
  - project: anuket/releng
    file: '/gitlab-templates/Docker.gitlab-ci.yml'
  - project: anuket/releng
    file: '/gitlab-templates/GoogleStorage.gitlab-ci.yml'

variables:
  DOCKER_REGISTRY: docker.io

.tox-defaults: &tox-defaults
  stage: test
  image: python:3.6
  before_script:
    - pip install tox tox-pip-version
  cache:
    paths:
      - .cache/pip
      - venv/
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

pep8:
  <<: *tox-defaults
  stage: build
  script:
    tox -e pep8

tox-py36:
  <<: *tox-defaults
  script:
    tox -e py36

verify-image:
  stage: build
  image: centos:7
  before_script:
    - yum -y install python3 qemu-img kpartx sudo e2fsprogs
    - python3 -m venv venv
  script:
    - source venv/bin/activate
    - !reference [.gsutil-install, script]
    - cd nfvbenchvm/dib
    - |
        echo -e "\e[0Ksection_start:`date +%s`:build_image\r\e[0KBuild Image"
        bash verify-image.sh -v
        echo -e "\e[0Ksection_end:`date +%s`:build_image\r\e[0K"
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

build-image:
  stage: deploy
  image: centos:7
  before_script:
    - yum -y install python3 qemu-img kpartx sudo e2fsprogs
    - python3 -m venv venv
  script:
    - source venv/bin/activate
    - !reference [.gsutil-install, script]
    - cd nfvbenchvm/dib
    - |
        echo -e "\e[0Ksection_start:`date +%s`:build_image\r\e[0KBuild Image"
        bash build-image.sh
        echo -e "\e[0Ksection_end:`date +%s`:build_image\r\e[0K"
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

docker-build-nfvbench:
  extends: .docker-build-and-push
  variables:
    DOCKER_IMAGE: "$DOCKER_ORGANIZATION/nfvbench"
    DOCKER_BUILDCONTEXT: "docker"
    DOCKER_FILEPATH: "docker/Dockerfile"