2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=========================================================
20 # Pull type files from repos
21 # Set up the CM import resolver
22 # $1 is the DCAE repo URL
23 # $2 is the CCSDK repo URL
26 DEST=/opt/manager/resources/onapspec
27 EXTRA_RULES=/opt/manager/extra-resolver-rules
31 /dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml \
32 /relationshipplugin/1.1.0/relationshipplugin_types.yaml \
33 /k8splugin/1.7.2/k8splugin_types.yaml \
34 /k8splugin/2.0.0/k8splugin_types.yaml \
35 clamppolicyplugin/1.1.0/clamppolicyplugin_types.yaml \
41 /type_files/pgaas/1.1.0/pgaas_types.yaml \
42 /type_files/sshkeyshare/sshkey_types.yaml \
43 /type_files/helm/4.0.2/helm-type.yaml \
44 /type_files/dmaap/dmaap.yaml \
49 for typefile in ${DCAETYPEFILES}
51 mkdir -p ${DEST}/$(dirname ${typefile})
52 curl -Ss -L -f $1/${typefile} >> ${DEST}/${typefile}
55 for typefile in ${CCSDKTYPEFILES}
57 mkdir -p ${DEST}/$(dirname ${typefile})
58 curl -Ss -L -f $2/${typefile} >> ${DEST}/${typefile}
61 chown cfyuser:cfyuser ${DEST}
63 # Add our local type file store to CM import resolver configuration
64 TYPE_RULE0="{\"$1\": \"file://${DEST}\"}"
65 TYPE_RULE1="{\"$2\": \"file://${DEST}\"}"
66 # This sed re is 'brittle' but we can be sure the config.yaml file
67 # won't change as long as we do not change the source Docker image for CM
68 sed -i -e "s# rules:# rules:\n - ${TYPE_RULE0}#" /etc/cloudify/config.yaml
69 sed -i -e "s# rules:# rules:\n - ${TYPE_RULE1}#" /etc/cloudify/config.yaml
71 chown cfyuser:cfyuser /etc/cloudify/config.yaml
73 # Changing /etc/cloudify/config.yaml is no longer sufficient
74 # Need to provide the additional rules in a file that can be
75 # used at deployment time to update the resolver rules
76 echo "- ${TYPE_RULE0}" > ${EXTRA_RULES}
77 echo "- ${TYPE_RULE1}" >> ${EXTRA_RULES}