summaryrefslogtreecommitdiffstats
path: root/huawei/vnfmadapter/VnfmadapterService/docker
diff options
context:
space:
mode:
authorabhishek bajaj <abhishek.kumar.bajaj@huawei.com>2021-06-23 10:59:33 +0530
committerabhishek bajaj <abhishek.kumar.bajaj@huawei.com>2021-06-23 12:00:53 +0530
commitc99046fe4d1534d0acb055ae1c2a5ef7f24c96b2 (patch)
tree021ff4244ac033fb303c4906448eea02ceb18db8 /huawei/vnfmadapter/VnfmadapterService/docker
parent351b0b9e863b9ed4e898a7a12c6485d40eb899a3 (diff)
Failed to fetch huawei:latest image when running Jenkins job
Issue-ID: VFC-1864 Signed-off-by: abhishek bajaj <abhishek.kumar.bajaj@huawei.com> Change-Id: I6a2404da2b14ea2459c23af7efceb18bf3143649
Diffstat (limited to 'huawei/vnfmadapter/VnfmadapterService/docker')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh84
1 files changed, 31 insertions, 53 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh b/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
index 7c4d235a..c82b81a8 100644
--- a/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
+++ b/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
@@ -1,69 +1,47 @@
#!/bin/bash
-add_user(){
-
- useradd onap
-}
-set_up_mysql_jdk(){
+install_sf(){
- sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
- sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo
- yum -y update
+ apk --no-cache update
+ apk --no-cache add bash curl gcc wget mysql-client openssl-dev
+ apk --no-cache add libffi-dev musl-dev py3-virtualenv
- yum -y install wget unzip socat java-11-openjdk-headless
- sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security
-
- # Set up mysql
- wget -q http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm && \
- rpm -ivh mysql-community-release-el7-5.noarch.rpm && \
- rm -f mysql-community-release-el7-5.noarch.rpm
- yum -y update
- yum -y install mysql-server
- mysql_install_db --user=onap --datadir=/var/lib/mysql
- chown onap:onap -R /var/run/mysqld
- chmod g+s /var/run/mysqld
- setfacl -d --set u:onap:rwx /var/run/mysqld
- chown onap:onap /var/log/mysqld.log
- chmod g+s /var/log/mysqld.log
- chown onap:onap -R /var/lib/mysql-files
- chmod g+s /var/lib/mysql-files
- setfacl -d --set u:onap:rwx /var/lib/mysql-files
- chown onap:onap /etc/my.cnf
+ # get binary zip from nexus - nfvo-driver-vnfm-huawei.zip
+ wget -q -O nfvo-driver-vnfm-huawei.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.driver.vnfm.svnfm.huawei.vnfmadapter&a=hw-vnfmadapter-deployment&v=${PKG_VERSION}-SNAPSHOT&e=zip" && \
+ unzip -q -o -B nfvo-driver-vnfm-huawei.zip && \
+ rm -f nfvo-driver-vnfm-huawei.zip
+ wait
+ pip install --upgrade setuptools pip
+ pip install --no-cache-dir --pre -r /service/vfc/nfvo/driver/vnfm/svnfm/huawei/vnfmadapter/requirements.txt
+ find /service -name '*.sh'|xargs chmod a+x
}
-set_up_tomcat(){
+add_user(){
- # Set up tomcat
- wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.30/bin/apache-tomcat-8.5.30.tar.gz && \
- tar --strip-components=1 -xf apache-tomcat-8.5.30.tar.gz && \
- rm -f apache-tomcat-8.5.30.tar.gz && \
- rm -rf webapps && \
- mkdir -p webapps/ROOT
- echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xms64m -Xmx256m -XX:MaxPermSize=64m"' > /service/bin/setenv.sh
+ addgroup -g 1000 -S onap
+ adduser onap -D -G onap -u 1000
+ chown onap:onap -R /service
+}
- # Set up microservice
- wget -q -O nfvo-driver-vnfm-huawei.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.driver.vnfm.svnfm.huawei.vnfmadapter&a=hw-vnfmadapter-deployment&v=${PKG_VERSION}-SNAPSHOT&e=zip" && \
- unzip -q -o -B nfvo-driver-vnfm-huawei.zip && \
- rm -f nfvo-driver-vnfm-huawei.zip
+config_logdir(){
- # Set permissions
- find . -type d -exec chmod o-w {} \;
- find . -name "*.sh" -exec chmod +x {} \;
-
- chown onap:onap -R /service
- chmod g+s /service
- setfacl -d --set u:onap:rwx /service
+ if [ ! -d "/var/log/onap" ]; then
+ mkdir /var/log/onap
+ fi
+ chown onap:onap -R /var/log/onap
+ chmod g+s /var/log/onap
+
}
-
clean_sf_cache(){
-
- yum clean all
+
+ rm -rf /var/cache/apk/*
+ rm -rf /root/.cache/pip/*
+ rm -rf /tmp/*
}
-add_user
-set_up_mysql_jdk
-wait
-set_up_tomcat
+install_sf
wait
+add_user
+config_logdir
clean_sf_cache