diff options
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile | 32 | ||||
-rw-r--r-- | docker/Dockerfile.aarch64.patch | 23 | ||||
-rw-r--r-- | docker/get_db_schema.py | 61 |
3 files changed, 99 insertions, 17 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 8cc15e0b..eb85ea49 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,6 +2,8 @@ FROM ubuntu:14.04 MAINTAINER Leo Wang <grakiss.wanglei@huawei.com> LABEL version="0.1" description="OPNFV Dovetail Docker Container" +ARG BRANCH=master + RUN \ apt-get update \ && \ @@ -13,27 +15,35 @@ RUN \ python-mock \ python-pip \ apt-transport-https \ + wget \ --no-install-recommends \ && \ - apt-get update && apt-get -y install docker.io + apt-get update + +RUN wget -qO- https://get.docker.com/ \ +| \ + sed 's/-q docker-ce/-q docker-ce=17.03.0~ce-0~ubuntu-trusty/' \ +| \ + sed 's/edge/stable/' \ +| \ + sh ENV HOME /home/opnfv ENV REPOS_DIR ${HOME}/dovetail WORKDIR /home/opnfv RUN \ - git config --global http.sslVerify false \ -&& \ - git clone https://git.opnfv.org/dovetail ${REPOS_DIR} \ + mkdir -p ${REPOS_DIR} \ && \ - mkdir -p ${REPOS_DIR}/results \ -&& \ - pip install -U pip \ -&& \ - pip install -r ${REPOS_DIR}/requirements.txt \ + git config --global http.sslVerify false \ && \ - cd ${REPOS_DIR} \ + pip install git+https://git.opnfv.org/dovetail@$BRANCH#egg=dovetail \ && \ - pip install -e . + ln -s /usr/local/lib/python2.7/dist-packages/dovetail ${REPOS_DIR}/dovetail WORKDIR ${REPOS_DIR}/dovetail + +# get db schema from opnfv sites +RUN mkdir -p ${REPOS_DIR}/dovetail/utils/local_db +ADD get_db_schema.py ${REPOS_DIR}/dovetail/utils/local_db +RUN cd ${REPOS_DIR}/dovetail/utils/local_db && python get_db_schema.py diff --git a/docker/Dockerfile.aarch64.patch b/docker/Dockerfile.aarch64.patch index b96b619f..50fdc75c 100644 --- a/docker/Dockerfile.aarch64.patch +++ b/docker/Dockerfile.aarch64.patch @@ -1,14 +1,14 @@ From: Alexandru Nemes <alexandru.nemes@enea.com> -Date: Mon, 24 Apr 2017 11:53:42 +0300 +Date: Mon, 8 May 2017 19:04:37 +0300 Subject: [PATCH] Add AArch64 support for Dovetail docker file Signed-off-by: Alexandru Nemes <alexandru.nemes@enea.com> --- - docker/Dockerfile | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) + docker/Dockerfile | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile -index 8cc15e0..bbab012 100644 +index 499624f..bbab012 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ @@ -21,7 +21,18 @@ index 8cc15e0..bbab012 100644 RUN \ apt-get update \ -@@ -28,6 +28,8 @@ RUN \ +@@ -16,9 +16,7 @@ RUN \ + wget \ + --no-install-recommends \ + && \ +- apt-get update +- +-RUN wget -qO- https://get.docker.com/ | sh ++ apt-get update && apt-get -y install docker.io + + ENV HOME /home/opnfv + ENV REPOS_DIR ${HOME}/dovetail +@@ -31,6 +29,8 @@ RUN \ && \ mkdir -p ${REPOS_DIR}/results \ && \ @@ -29,4 +40,4 @@ index 8cc15e0..bbab012 100644 +&& \ pip install -U pip \ && \ - pip install -r ${REPOS_DIR}/requirements.txt \ + pip install -r ${REPOS_DIR}/requirements.txt \
\ No newline at end of file diff --git a/docker/get_db_schema.py b/docker/get_db_schema.py new file mode 100644 index 00000000..9a9d10d4 --- /dev/null +++ b/docker/get_db_schema.py @@ -0,0 +1,61 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import requests +import json + + +source_url = 'http://testresults.opnfv.org/test/api/v1' + + +def get(url): + try: + ret = requests.get(url) + return ret.json() + except: + return None + + +def pod(): + source = '{}/pods'.format(source_url) + try: + pods = get(source)['pods'] + with open("pods.json", "w") as f: + f.write(json.dumps(pods, indent=4)) + except: + return + + +def project(): + source = '{}/projects'.format(source_url) + + try: + projects = get(source)['projects'] + with open("projects.json", "w") as f: + f.write(json.dumps(projects, indent=4)) + except: + return + + for p in projects: + source = '{}/projects/{}/cases'.format(source_url, p['name']) + print(p['name']) + print(source) + try: + cases = get(source) + with open("cases.json", "a+") as f: + f.write(json.dumps(cases)) + f.write('\n') + f.close() + except: + print("useless data") + + +if __name__ == '__main__': + pod() + project() |