Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 3 | source /var/onap/sdnc |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 4 | source /var/onap/functions |
| 5 | |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 6 | # _build_appc_images() - Function that creates APPC images from source code. |
| 7 | function _build_appc_images { |
| 8 | get_sdnc_images |
| 9 | build_docker_image $appc_src_folder/deployment/installation/appc docker |
| 10 | } |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 11 | |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 12 | # get_appc_images() - Function that gets or build APPC docker images |
| 13 | function get_appc_images { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 14 | if [[ "$build_image" == "True" ]]; then |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 15 | _build_appc_images |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 16 | else |
| 17 | pull_openecomp_image appc-image openecomp/appc-image:latest |
| 18 | pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest |
| 19 | fi |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | # install_appc() - Function that clones and installs the APPC services from source code |
| 23 | function install_appc { |
| 24 | pushd $appc_src_folder/deployment/docker-compose |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 25 | install_docker_compose |
| 26 | /opt/docker/docker-compose up -d |
| 27 | popd |
| 28 | } |
| 29 | |
| 30 | # init_appc() - Function that initialize APPC services |
| 31 | function init_appc { |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 32 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 33 | clone_repos "appc" |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 34 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 35 | compile_repos "appc" |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 36 | fi |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 37 | fi |
| 38 | |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 39 | if [[ "$skip_get_images" == "False" ]]; then |
| 40 | get_appc_images |
| 41 | if [[ "$skip_install" == "False" ]]; then |
| 42 | install_appc |
| 43 | fi |
| 44 | fi |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 45 | } |