-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·19 lines (15 loc) · 983 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
if [ "$#" -ne 4 ]; then
echo "You must enter exactly 4 command line arguments. One IBM Cloud API key, the name of the cluster, the region and the resource group"
fi
export IBMCLOUD_API_KEY=${1}
CLUSTER_NAME=\"${2}\"
REGION=\"${3}\"
RESOURCE_GROUP_NAME=\"${4}\"
# Substitute IBM Cloud API key and cluster name in terraform settings file
sed -i "s/ibmcloud_api_key=/ibmcloud_api_key=\"${IBMCLOUD_API_KEY}\"/g" /home/devops/src/settings/environment-ibmcloud.tfvars
sed -i "s/cluster_name=/cluster_name=${CLUSTER_NAME}/g" /home/devops/src/settings/environment-ibmcloud.tfvars
sed -i "s/registry_namespace=/registry_namespace=${CLUSTER_NAME}/g" /home/devops/src/settings/environment-ibmcloud.tfvars
sed -i "s/region=/region=${REGION}/g" /home/devops/src/settings/environment-ibmcloud.tfvars
sed -i "s/resource_group_name=/resource_group_name=${RESOURCE_GROUP_NAME}/g" /home/devops/src/settings/environment-ibmcloud.tfvars
/home/devops/src/runTerraform.sh --ibm -d -a