[TESTAPI] Add chown to allow start in openshift 89/72289/1
authormorganrol <morgan.richomme@orange.com>
Tue, 30 Mar 2021 05:50:38 +0000 (07:50 +0200)
committermorganrol <morgan.richomme@orange.com>
Tue, 30 Mar 2021 05:54:23 +0000 (07:54 +0200)
Some files of the testapi are located in system directories
- /etc/opnfv_testapi
- /usr/local/share/opnfv_testapi

it requires some root priviledge to execute them properly
especially in an openshift environment
this patch force the user right for these directories

another option could be to move these files in home directory
but so fare we are just changing the dockerization and did not
modify the code of the API.

Signed-off-by: morganrol <morgan.richomme@orange.com>
Change-Id: I7f9607f31e97d3bf8462ebe07fad0714aac47bdd

testapi/docker/Dockerfile

index d4446b3..651e8e0 100644 (file)
@@ -36,6 +36,10 @@ RUN apt-get update && apt-get install -y \
   groupadd -r $group && useradd -ms /bin/bash $user -g $group && \
   mkdir -p /home/ubuntu/releng-testresults && \
   chown -R $user:$group /home/ubuntu/releng-testresults && \
+  mkdir -p /etc/opnfv_testapi && \
+  chown -R $user:$group /etc/opnfv_testapi && \
+  mkdir -p /usr/local/share/opnfv_testapi && \
+  chown -R $user:$group /usr/local/share/opnfv_testapi && \
   git clone https://gerrit.opnfv.org/gerrit/releng-testresults \
     /home/ubuntu/releng-testresults && \
   pip install -r /home/ubuntu/releng-testresults/testapi/requirements.txt \