aboutsummaryrefslogtreecommitdiffstats
path: root/docker/docker-env-conf.sh
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2019-04-17 15:51:14 +0800
committeryangyan <yangyanyj@chinamobile.com>2019-04-17 15:51:38 +0800
commita1b865c98638224ff18f8a673f2a7a2ca875934d (patch)
tree49175210162113da82136e21611659471365e982 /docker/docker-env-conf.sh
parent29520a4f26aba16441e4c50714ea3f72f5d6c506 (diff)
Modify catalog docker file
Change-Id: I8230c1cacaa8145d96e6e5e251078cd28d267ae7 Signed-off-by: yangyan <yangyanyj@chinamobile.com> Issue-ID: VFC-1360
Diffstat (limited to 'docker/docker-env-conf.sh')
-rw-r--r--docker/docker-env-conf.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/docker/docker-env-conf.sh b/docker/docker-env-conf.sh
index 6e610ca7..cc6f4960 100644
--- a/docker/docker-env-conf.sh
+++ b/docker/docker-env-conf.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-config_env(){
+install_sf(){
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk --no-cache update
@@ -8,6 +8,7 @@ config_env(){
apk --no-cache add python-dev libffi-dev musl-dev py2-virtualenv
# get binary zip from nexus - vfc-nfvo-catalog
+
wget -q -O vfc-nfvo-catalog.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.catalog&a=vfc-nfvo-catalog&v=LATEST&e=zip' && \
unzip vfc-nfvo-catalog.zip && \
rm -rf vfc-nfvo-catalog.zip && \
@@ -15,7 +16,7 @@ config_env(){
pip install --no-cache-dir --pre -r /service/vfc/nfvo/catalog/requirements.txt
}
-add_onap(){
+add_user(){
apk --no-cache add sudo
addgroup -g 1000 -S onap && \
@@ -23,20 +24,32 @@ add_onap(){
chmod u+w /etc/sudoers && \
sed -i '/User privilege/a\\onap ALL=(ALL:ALL) NOPASSWD:ALL' /etc/sudoers && \
chmod u-x /etc/sudoers && \
- chown onap:onap -R /service
+ sudo chown onap:onap -R /service
+}
+
+config_logdir(){
+
+ if [ ! -d "/var/log/onap" ]; then
+ sudo mkdir /var/log/onap
+ fi
+
+ sudo chown onap:onap -R /var/log/onap
+ chmod g+s /var/log/onap
+
}
-clean_env(){
+clean_sf_cache(){
rm -rf /var/cache/apk/*
rm -rf /root/.cache/pip/*
rm -rf /tmp/*
}
-config_env
+install_sf
wait
-add_onap
-clean_env
+add_user
+config_logdir
+clean_sf_cache