-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitCloneAllTFAWSSampleRepos.sh
executable file
·74 lines (63 loc) · 3.56 KB
/
gitCloneAllTFAWSSampleRepos.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
RUN_CONTEXT_DIR="$(pwd)";
LOCAL_ROOT_DIR="/home/$(whoami)/scripts/_GitPages/strapicms-src/terraform-aws-modules-full";
echo "mkdir -p ${LOCAL_ROOT_DIR};";
mkdir -p ${LOCAL_ROOT_DIR};
cd ${LOCAL_ROOT_DIR};
pwd;
echo "Cloning All Terraform AWS Module Samples in to: ${LOCAL_ROOT_DIR}";
declare -A tfAwsSampleModuleGitRepos=(
[0]="https://github.com/terraform-aws-modules/terraform-aws-cloudfront" \
[1]="https://github.com/terraform-aws-modules/terraform-aws-rds-aurora" \
[2]="https://github.com/terraform-aws-modules/terraform-aws-eventbridge" \
[3]="https://github.com/terraform-aws-modules/terraform-aws-route53" \
[4]="https://github.com/terraform-aws-modules/terraform-aws-s3-bucket" \
[5]="https://github.com/terraform-aws-modules/terraform-aws-alb" \
[6]="https://github.com/terraform-aws-modules/terraform-aws-vpc" \
[7]="https://github.com/terraform-aws-modules/terraform-aws-eks" \
[8]="https://github.com/terraform-aws-modules/terraform-aws-ec2-instance" \
[9]="https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2" \
[10]="https://github.com/terraform-aws-modules/terraform-aws-rds" \
[11]="https://github.com/terraform-aws-modules/terraform-aws-atlantis" \
[12]="https://github.com/terraform-aws-modules/terraform-aws-notify-slack" \
[13]="https://github.com/terraform-aws-modules/terraform-aws-transit-gateway" \
[14]="https://github.com/terraform-aws-modules/terraform-aws-autoscaling" \
[15]="https://github.com/terraform-aws-modules/terraform-aws-appsync" \
[16]="https://github.com/terraform-aws-modules/terraform-aws-step-functions" \
[17]="https://github.com/terraform-aws-modules/terraform-aws-security-group" \
[18]="https://github.com/terraform-aws-modules/terraform-aws-vpn-gateway" \
[19]="https://github.com/terraform-aws-modules/terraform-aws-elb" \
[20]="https://github.com/terraform-aws-modules/terraform-aws-redshift" \
[21]="https://github.com/terraform-aws-modules/terraform-aws-acm" \
[22]="https://github.com/terraform-aws-modules/terraform-aws-iam" \
[23]="https://github.com/terraform-aws-modules/terraform-aws-ecs" \
[24]="https://github.com/terraform-aws-modules/terraform-aws-pricing" \
[25]="https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table" \
[26]="https://github.com/terraform-aws-modules/terraform-aws-sns" \
[27]="https://github.com/terraform-aws-modules/terraform-aws-sqs" \
[28]="https://github.com/terraform-aws-modules/terraform-aws-cloudwatch" \
[29]="https://github.com/terraform-aws-modules/terraform-aws-key-pair" \
[30]="https://github.com/terraform-aws-modules/terraform-aws-customer-gateway" \
[31]="https://github.com/terraform-aws-modules/terraform-aws-ebs-optimized" \
[32]="https://github.com/terraform-aws-modules/atlantis-demo"
);
for i in "${!tfAwsSampleModuleGitRepos[@]}"
do
echo "key : $i";
echo "val : ${tfAwsSampleModuleGitRepos[$i]}";
echo "Check for Existing Local Clone: ${LOCAL_ROOT_DIR}/${tfAwsSampleModuleGitRepos[$i]##*/}";
if [[ -d "${LOCAL_ROOT_DIR}/${tfAwsSampleModuleGitRepos[$i]##*/}" ]];
then
echo "Found Local Clone on Filesystem: ${LOCAL_ROOT_DIR}/${tfAwsSampleModuleGitRepos[$i]##*/}";
cd "${LOCAL_ROOT_DIR}/${tfAwsSampleModuleGitRepos[$i]##*/}";
echo "git pull origin master;";
git pull origin master;
cd ${LOCAL_ROOT_DIR};
else
echo "Exec Bootstrap Clone For: ${tfAwsSampleModuleGitRepos[$i]}";
echo "git clone ${tfAwsSampleModuleGitRepos[$i]};";
git clone ${tfAwsSampleModuleGitRepos[$i]};
fi
done;
cd ${RUN_CONTEXT_DIR};
echo "All Terraform AWS Module Sample Repositores Cloned to Localhost Successfully!";