forked from SUSE-Cloud/automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_suse_cloud
executable file
·50 lines (40 loc) · 1.85 KB
/
install_suse_cloud
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
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
set -o nounset
commands="cleanup prepare setupadmin addupdaterepo runupdate prepareinstcrowbar instcrowbar rebootcrowbar setupnodes instnodes proposal testsetup cct rebootcloud $@" # all_noreboot
currentdir=$(pwd)
function deploy_upgrade_clouds() {
clouds=`seq $1 $2` # Expand the sequence.
suse_cloud_config=$3
# Gracefully close existing screen sessions created by the script.
screen -S $suse_cloud_config -X quit
# Create new screen sessions.
screen -S $suse_cloud_config -d -m -t info_$suse_cloud_config bash -c "cat message; echo \"Cloud Upgrade Step: $suse_cloud_config\"; bash"
for i in $clouds; do
echo "Deploying cloud number $i -- To Rock but not to roll!!!"
# Run similar copies of mkcloud runs in the same screen session as tabs.
mkdir -p pids/$i # Create folders for automation pid's files and artifacts.
screen -S $suse_cloud_config -X screen -t Cloud$i bash -c "cd pids/$i; source ../../mkcloudconfig/SUSECloud.mkcloud $i; ../../mkcloudconfig/$suse_cloud_config $commands; exec bash"
cd $currentdir
done
}
# psalunke: Add a basic API call and warning's with user input
# so that we do not redeploy the entire thing and
# disrupt other's work for the same ...
function usage() {
echo "Not Implemented yet!"
}
# Using deploy cloud function
# $startnumber & $endnumber expands into a sequence and deploys `range($startnumber, $endnumber)` number of clouds.
# $cloudscript_name is basically coming from the folder mkcloudconfig/$cloudconfig
#deploy_upgrade_clouds $startnumber $endnumber $cloudconfig
# Deploy SUSE Cloud 6 Scenarios
deploy_upgrade_clouds 1 2 cloud6
# Deploy SUSE Cloud 7 Scenarios
deploy_upgrade_clouds 3 4 cloud7
# Deploy Upgrade Steps
# Step 1
# Step 2
# Step 3 ...
# Todo
# 1. setup auto-monitoring ...
# 2. generate workload automatically ...