diff options
author | 2021-06-07 07:52:53 -0700 | |
---|---|---|
committer | 2021-08-25 11:35:19 +0000 | |
commit | d31c6da85b6512c104b54e4ced40892d04012c8f (patch) | |
tree | 2d6b5d8bb22093260281bb07d4582e37f0886a01 | |
parent | 58a44a8ea1e48ba8936485086794cb59795a2d03 (diff) |
Add Gitlab-CI Configuration
Adds jobs for tox verification, ReadTheDocs builds on changes to docs/,
docker image builds, and disk image verification and builds.
Change-Id: Ie8e579a12ae6a0efd325a04de670486cafd50f46
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
-rw-r--r-- | .gitlab-ci.yml | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..41d7fa2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,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:8 + before_script: + - dnf -y install python3-virtualenv + - virtualenv 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:8 + before_script: + - dnf -y install python3-virtualenv + - virtualenv 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" |