Failed to fetch huawei:latest image when running Jenkins job
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / docker / docker-env-config.sh
1 #!/bin/bash
2
3 install_sf(){
4
5     apk --no-cache update
6     apk --no-cache add bash curl gcc wget mysql-client openssl-dev
7     apk --no-cache add libffi-dev musl-dev py3-virtualenv
8
9     # get binary zip from nexus - nfvo-driver-vnfm-huawei.zip
10     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" && \
11     unzip -q -o -B nfvo-driver-vnfm-huawei.zip && \
12     rm -f nfvo-driver-vnfm-huawei.zip
13     wait
14     pip install --upgrade setuptools pip
15     pip install --no-cache-dir --pre -r  /service/vfc/nfvo/driver/vnfm/svnfm/huawei/vnfmadapter/requirements.txt
16     find  /service -name '*.sh'|xargs chmod a+x
17 }
18
19 add_user(){
20
21     addgroup -g 1000 -S onap
22     adduser onap -D -G onap -u 1000
23     chown onap:onap -R /service
24 }
25
26 config_logdir(){
27
28     if [ ! -d "/var/log/onap" ]; then
29        mkdir /var/log/onap
30     fi 
31     chown onap:onap -R /var/log/onap
32     chmod g+s /var/log/onap
33     
34 }
35
36 clean_sf_cache(){
37
38     rm -rf /var/cache/apk/*
39     rm -rf /root/.cache/pip/*
40     rm -rf /tmp/*
41 }
42
43 install_sf
44 wait
45 add_user
46 config_logdir
47 clean_sf_cache