summaryrefslogtreecommitdiffstats
path: root/k8s-bootstrap-container/bootstrap.sh
blob: 38da261ca4a06cf485146e88a4b0772c5937814d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Install DCAE via Cloudify Manager
# Expects:
#   CM address (IP or DNS) in CMADDR environment variable
#   CM password in CMPASS environment variable (assumes user is "admin")
#   Plugin wagon files in /wagons

set -x

# Deploy components
# $1 -- name (for bp and deployment)
# $2 -- blueprint name
# $3 -- inputs file name
function deploy {
    cfy install -b $1 -d $1 -i /inputs/$3 /blueprints/$2
}
# Set up profile to access CMs
cfy profiles use -u admin -t default_tenant -p "${CMPASS}"  "${CMADDR}"

# Output status, for debugging purposes
cfy status

# Load plugins onto CM
for wagon in /wagons/*.wgn
do
    cfy plugins upload ${wagon}
done

# Deploy platform components
deploy config_binding_service k8s-config_binding_service.yaml k8s-config_binding_service-inputs.yaml
deploy inventory k8s-inventory.yaml k8s-inventory-inputs.yaml
deploy deployment_handler k8s-deployment_handler.yaml k8s-deployment_handler-inputs.yaml
deploy policy_handler k8s-policy_handler.yaml k8s-policy_handler-inputs.yaml

# Keep the container running
# Useful to exec into it for debugging and uninstallation
while true
do
    sleep 120
done