summaryrefslogtreecommitdiffstats
path: root/lib/dcae
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-03-13 12:26:08 -0700
committerVictor Morales <victor.morales@intel.com>2018-03-13 12:26:08 -0700
commit4d7590ed7425a94c0f87a8461548c2461d79a710 (patch)
tree083ffc33a4cd6d8eff42deeea1da0b50c49efdfe /lib/dcae
parentceb22354fcb078e8991a66dc9bc11dd5f21e77f4 (diff)
Migrate vagrant-onap to devtool repo
This change covers the migration of the vagrant-onap tool's code which was located under integration repo to devtool's repository. The tool was renamed to avoid misunderstandings about its goals. Change-Id: I79df8c35fccaa266a789217d441a6cf1183bd42a Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: INT-441
Diffstat (limited to 'lib/dcae')
-rwxr-xr-xlib/dcae92
1 files changed, 92 insertions, 0 deletions
diff --git a/lib/dcae b/lib/dcae
new file mode 100755
index 0000000..25efddd
--- /dev/null
+++ b/lib/dcae
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+source /var/onap/functions
+
+# _create_config_file() - Creates a configuration yaml file for the controller
+function _create_config_file {
+ cat > ${src_folders[dcae]}/controller/config.yaml << EOL
+ZONE: $dcae_zone
+STATE: $dcae_state
+DCAE-VERSION: $artifacts_version
+HORIZON-URL: https://mycloud.rackspace.com/cloud/$tenant_id
+KEYSTONE-URL: https://identity.api.rackspacecloud.com/v2.0
+OPENSTACK-TENANT-ID: $tenant_id
+OPENSTACK-TENANT-NAME: OPEN-ECOMP
+OPENSTACK-REGION: $openstack_region
+OPENSTACK-PRIVATE-NETWORK: $openstack_private_network_name
+OPENSTACK-USER: $openstack_user
+OPENSTACK-PASSWORD: $openstack_password
+OPENSTACK-KEYNAME: ${key_name}${rand_str}_dcae
+OPENSTACK-PUBKEY: $pub_key
+
+NEXUS-URL-ROOT: $nexus_repo_root
+NEXUS-USER: $nexus_username
+NEXUS-PASSWORD: $nexus_password
+NEXUS-URL-SNAPSHOTS: $nexus_url_snapshots
+NEXUS-RAWURL: $nexus_repo
+
+DOCKER-REGISTRY: $nexus_docker_repo
+
+GIT-MR-REPO: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git
+EOL
+}
+
+# _build_dcae_images() Function that builds DCAE docker images from source code.
+function _build_dcae_images {
+ if [[ "$compile_repo" != "True" ]]; then
+ compile_repos "dcae"
+ fi
+ build_docker_image ${src_folders[dcae]}/dmaapbc openecomp/dcae-dmaapbc
+ build_docker_image ${src_folders[dcae]}/orch-dispatcher dcae/orch-dispatcher
+
+ pushd ${src_folders[dcae]}/demo
+ bash dcae-demo-controller/src/main/docker-build/build.sh
+ popd
+
+ build_docker_image ${src_folders[dcae]}/dcae-inventory
+}
+
+# get_dcae_images() - Function that retrieves or builds DCAE docker images.
+function get_dcae_images {
+ if [[ "$build_image" == "True" ]]; then
+ _build_dcae_images
+ else
+ pull_openecomp_image dcae-dmaapbc openecomp/dcae-dmaapbc
+ pull_openecomp_image dcae-controller
+ fi
+}
+
+# install_dcae() - Function that clones and installs the DCAE controller services from source code
+function install_dcae {
+ pushd ${src_folders[dcae]}/demo/startup/controller
+ if [[ "$build_image" == "True" ]]; then
+ dcae_image=`docker images | grep dcae-controller | awk '{print $1 ":" $2}'`
+ sed -i "s|DOCKER-REGISTRY/openecomp/dcae-controller:DCAE-VERSION|$dcae_image|g" docker-compose.yml
+ sed -i "s|MTU|$MTU|g" docker-compose.yml
+ run_docker_compose .
+ else
+ bash init.sh
+ install_package make
+ make up
+ fi
+ popd
+ # run_docker_image -p 8080:8080 -d -v <some local directory>/config.yml:/opt/config.yml --name dcae-inventory <docker registry>/dcae-inventory:<version>
+}
+
+# init_dcae() - Function that initialize DCAE Controller services
+function init_dcae {
+ if [[ "$clone_repo" == "True" ]]; then
+ clone_repos "dcae"
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_repos "dcae"
+ fi
+ fi
+
+ _create_config_file
+ if [[ "$skip_get_images" == "False" ]]; then
+ get_dcae_images
+ if [[ "$skip_install" == "False" ]]; then
+ install_dcae
+ fi
+ fi
+}