3 # ============LICENSE_START=======================================================
5 # ================================================================================
6 # Copyright (C) 2017 AT&T Intellectual Property. All rights
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END============================================
21 # ===================================================================
22 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
25 echo "This is ${WORKSPACE}/scripts/vvp/clone_and_setup_vvp_data.sh"
27 # Clone vvp enviroment template
28 mkdir -p ${WORKSPACE}/data/environments/
29 mkdir -p ${WORKSPACE}/data/clone/
30 mkdir -p /opt/configmaps/settings/
32 cd ${WORKSPACE}/data/clone
33 git clone --depth 1 http://gerrit.onap.org/r/vvp/engagementmgr -b master
35 chmod -R 775 ${WORKSPACE}/data/
37 # copy settings file from tox environment infrastructure:
38 cp -f ${WORKSPACE}/data/clone/engagementmgr/django/vvp/settings/tox_settings.py /opt/configmaps/settings/__init__.py
40 # uwsgi.ini file creation
45 module = vvp.wsgi:application
47 pidfile = /tmp/project-master.pid
52 stats-http = True" > /opt/configmaps/settings/uwsgi.ini
54 # storage.py file creation
55 echo "from storages.backends.s3boto import S3BotoStorage
56 from django.conf import settings
57 class S3StaticStorage(S3BotoStorage):
58 custom_domain = '%s/%s' % (settings.AWS_S3_HOST, settings.STATIC_BUCKET)
59 bucket_name = settings.STATIC_BUCKET
60 class S3MediaStorage(S3BotoStorage):
61 custom_domain = '%s/%s' % (settings.AWS_S3_HOST, settings.MEDIA_BUCKET)
62 bucket_name = settings.MEDIA_BUCKET" > /opt/configmaps/settings/storage.py
64 # envbool.py file creation
66 def envbool(key, default=False, unknown=True):
67 return {'true': True, '1': True, 'false': False, '0': False,
68 '': default,}.get(os.getenv(key, '').lower(), unknown)" > /opt/configmaps/settings/envbool.py
70 # vvp_env.list file creation
71 echo "# set enviroment variables
72 OAUTHLIB_INSECURE_TRANSPORT=1
74 ENVNAME=${ENVIRONMENT}
75 http_proxy=${http_proxy}
76 https_proxy=${https_proxy}
78 DJANGO_SETTINGS_MODULE=vvp.settings
79 # export PYTHONPATH={pwd}
80 SECRET_KEY=6mo22&FAKEFALEFALEFKEuq0u*4ksk^aq8lte&)yul
81 ENVIRONMENT=development
82 SERVICE_PROVIDER=ExampleProvider
84 PROGRAM_NAME_URL_PREFIX=vvp
85 SERVICE_PROVIDER_DOMAIN=example-domain.com
95 SECRET_WEBHOOK_TOKEN=AiwiFAKEFAKEFAKEmahch2zahshaGi
96 SECRET_GITLAB_AUTH_TOKEN=ieNgFAKEFAKE4zohvee9a
97 SECRET_JENKINS_PASSWORD=xaiyiFAKEFAKEqueuBu
98 SECRET_CMS_APP_CLIENT_ID=MHmJo0ccDhFAKEFAKEFAKEPAC6H6HAMzhCCM16
99 SECRET_CMS_APP_CLIENT_SECRET=nI8QFAKEEEpnw5nTs
103 AWS_ACCESS_KEY_ID=FD2FAKEFAKEFAKEVD1MWRN
104 AWS_SECRET_ACCESS_KEY=TKoiwxzFAKEFAKEFAKEFAKEFAKEQ27nP2lCiutEsD
105 STATIC_ROOT=/app/htdocs" > ${WORKSPACE}/data/environments/vvp_env.list
109 IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'`
110 export HOST_IP=$IP_ADDRESS