8
8
case $i in
9
9
--subscription_id=* )
10
10
subscription_id=" ${i#* =} "
11
- shift
11
+ shift
12
12
;;
13
13
--resource_group_name=* )
14
14
resource_group_name=" ${i#* =} "
15
- shift
15
+ shift
16
16
;;
17
17
--nginx_deployment_name=* )
18
18
nginx_deployment_name=" ${i#* =} "
19
- shift
19
+ shift
20
20
;;
21
21
--config_dir_path=* )
22
22
config_dir_path=" ${i#* =} "
23
- shift
23
+ shift
24
24
;;
25
25
--root_config_file=* )
26
26
root_config_file=" ${i#* =} "
27
- shift
27
+ shift
28
28
;;
29
29
--transformed_config_dir_path=* )
30
30
transformed_config_dir_path=" ${i#* =} "
31
- shift
31
+ shift
32
+ ;;
33
+ --debug=* )
34
+ debug=" ${i#* =} "
35
+ shift
32
36
;;
33
37
* )
34
38
echo " Not matched option '${i#* =} ' passed in."
40
44
if [[ ! -v subscription_id ]];
41
45
then
42
46
echo " Please set 'subscription-id' ..."
43
- exit 1
47
+ exit 1
44
48
fi
45
49
if [[ ! -v resource_group_name ]];
46
50
then
47
51
echo " Please set 'resource-group-name' ..."
48
- exit 1
52
+ exit 1
49
53
fi
50
54
if [[ ! -v nginx_deployment_name ]];
51
55
then
52
56
echo " Please set 'nginx-deployment-name' ..."
53
- exit 1
57
+ exit 1
54
58
fi
55
59
if [[ ! -v config_dir_path ]];
56
60
then
57
61
echo " Please set 'nginx-config-directory-path' ..."
58
- exit 1
62
+ exit 1
59
63
fi
60
64
if [[ ! -v root_config_file ]];
61
65
then
62
66
echo " Please set 'nginx-root-config-file' ..."
63
- exit 1
67
+ exit 1
64
68
fi
65
69
66
70
# Validation and preprocessing
78
82
if [[ -d " $config_dir_path " ]]
79
83
then
80
84
echo " The NGINX configuration directory '$config_dir_path ' was found."
81
- else
85
+ else
82
86
echo " The NGINX configuration directory '$config_dir_path ' does not exist."
83
87
exit 1
84
88
fi
@@ -96,7 +100,7 @@ root_config_file_repo_path="$config_dir_path$root_config_file"
96
100
if [[ -f " $root_config_file_repo_path " ]]
97
101
then
98
102
echo " The root NGINX configuration file '$root_config_file_repo_path ' was found."
99
- else
103
+ else
100
104
echo " The root NGINX configuration file '$root_config_file_repo_path ' does not exist."
101
105
exit 1
102
106
fi
@@ -152,4 +156,25 @@ echo "ARM template deployment name: $template_deployment_name"
152
156
echo " "
153
157
154
158
az account set -s " $subscription_id " --verbose
155
- az deployment group create --name " $template_deployment_name " --resource-group " $resource_group_name " --template-file " $template_file " --parameters nginxDeploymentName=" $nginx_deployment_name " rootFile=" $transformed_root_config_file_path " tarball=" $encoded_config_tarball " --verbose
159
+
160
+ az_cmd=(
161
+ " az"
162
+ " deployment"
163
+ " group"
164
+ " create"
165
+ " --name" " $template_deployment_name "
166
+ " --resource-group" " $resource_group_name "
167
+ " --template-file" " $template_file "
168
+ " --parameters"
169
+ " nginxDeploymentName=$nginx_deployment_name "
170
+ " rootFile=$transformed_root_config_file_path "
171
+ " tarball=$encoded_config_tarball "
172
+ " --verbose"
173
+ )
174
+
175
+ if [[ " $debug " == true ]]; then
176
+ az_cmd+=(" --debug" )
177
+ fi
178
+
179
+ echo " ${az_cmd[@]} "
180
+ " ${az_cmd[@]} "
0 commit comments