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 |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame^] | 9 | build_docker_image ${src_folders[appc]}/deployment/installation/appc docker |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 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 |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame^] | 17 | for image in appc-image dgbuilder-sdnc-image; do |
| 18 | pull_openecomp_image $image openecomp/$image:latest |
| 19 | done |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 20 | fi |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | # install_appc() - Function that clones and installs the APPC services from source code |
| 24 | function install_appc { |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame^] | 25 | run_docker_compose ${src_folders[appc]}/deployment/docker-compose |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | # init_appc() - Function that initialize APPC services |
| 29 | function init_appc { |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 30 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 31 | clone_repos "appc" |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 32 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 33 | compile_repos "appc" |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 34 | fi |
Victor Morales | 65deef2 | 2017-08-18 20:53:42 -0500 | [diff] [blame] | 35 | fi |
| 36 | |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 37 | if [[ "$skip_get_images" == "False" ]]; then |
| 38 | get_appc_images |
| 39 | if [[ "$skip_install" == "False" ]]; then |
| 40 | install_appc |
| 41 | fi |
| 42 | fi |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 43 | } |