1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright 2017 AT&T Intellectual Property. All rights reserved.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # 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.
19 #==================LICENSE_END============================================
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 ##########################################################################
25 heat_template_version: 2013-05-23
27 description: Heat template to build vCPE vGateway (vG)
38 label: Image name or ID
39 description: Image to be used for compute instance
43 description: Type of instance (flavor) to be used
46 label: Public network name or ID
47 description: Public network that enables remote connection to VNF
51 description: Name of the vGW
55 description: The VNF ID is provided by ONAP
59 description: The vCPE Module ID is provided by ONAP
62 label: DCAE collector IP address
63 description: IP address of the DCAE collector
66 label: DCAE collector port
67 description: Port of the DCAE collector
71 description: Public/Private key pair name
75 description: Public key to be installed on the compute instance
79 description: URL of the repository that hosts the demo packages
82 label: Script version number
83 description: Version number of the scripts that build the vGW
84 demo_artifacts_version:
86 label: Artifacts version used in demo vnfs
87 description: Artifacts (jar, tar.gz) version used in demo vnfs
90 description: Root URL for the Nexus repository for Maven artifacts.
91 default: "https://nexus.onap.org"
94 label: Cloud environment
95 description: Cloud environment (e.g., openstack, rackspace)
98 label: VPP Source Git Repo
99 description: URL for VPP source codes
100 vpp_source_repo_release_tag:
102 label: VPP Source Git Release tag
103 description: Git release tag for the VPP source codes
104 hc2vpp_source_repo_url:
106 label: Honeycomb Source Git Repo
107 description: URL for Honeycomb source codes
108 hc2vpp_source_repo_release_tag:
110 label: Honeycomb Source Git release tag
111 description: Git release tag for the Honeycomb source codes
112 # Compile_state parameter is added to provide backward compatibility for Beijing and Amsterdam releases
116 description: State to compile code or not
128 type: OS::Heat::RandomString
133 type: OS::Nova::KeyPair
139 base: { get_param: key_name }
140 rand: { get_resource: random-str }
141 public_key: { get_param: pub_key }
142 save_private_key: false
144 # Virtual GW Instantiation
147 type: OS::Nova::Server
149 image: { get_param: vcpe_image_name }
150 flavor: { get_param: vcpe_flavor_name }
151 name: { get_param: vgw_name_0 }
152 key_name: { get_resource: my_keypair }
154 - network: { get_param: public_net_id }
155 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
156 user_data_format: RAW
160 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
161 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
162 __script_version__ : { get_param: script_version }
163 __cloud_env__ : { get_param: cloud_env }
164 __vpp_source_repo_url__ : { get_param: vpp_source_repo_url }
165 __vpp_source_repo_release_tag__ : { get_param: vpp_source_repo_release_tag }
166 __hc2vpp_source_repo_url__ : { get_param: hc2vpp_source_repo_url }
167 __hc2vpp_source_repo_release_tag__ : { get_param: hc2vpp_source_repo_release_tag }
168 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
169 __compile_state__ : {get_param : compile_state}
173 # Create configuration files
175 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
176 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
177 echo "__script_version__" > /opt/config/script_version.txt
178 echo "__cloud_env__" > /opt/config/cloud_env.txt
179 echo "__vpp_source_repo_url__" > /opt/config/vpp_source_repo_url.txt
180 echo "__vpp_source_repo_release_tag__" > /opt/config/vpp_source_repo_release_tag.txt
181 echo "__hc2vpp_source_repo_url__" > /opt/config/hc2vpp_source_repo_url.txt
182 echo "__hc2vpp_source_repo_release_tag__" > /opt/config/hc2vpp_source_repo_release_tag.txt
183 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
184 echo "__compile_state__" > /opt/config/compile_state.txt
186 # Download and run install script
187 apt-get -y install unzip
188 if [[ "__script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
189 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vcpe&a=vcpe-scripts&e=zip&v=__script_version__" -o /opt/vcpe-scripts-__script_version__.zip
190 unzip -j /opt/vcpe-scripts-__script_version__.zip -d /opt v_gw_build.sh
192 chmod +x v_gw_build.sh