-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·57 lines (46 loc) · 1.2 KB
/
build.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
#!/bin/bash
set -e
shopt -s extglob
current_dir=$(pwd)
script_name=$(basename "${BASH_SOURCE[0]}")
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
environment=$(basename $script_dir)
build_path_terraform=$script_dir/terraform
build_path_packer=$script_dir/packer
echo "-------"
echo "environment:"
echo $environment
echo "-------"
echo "script_name:"
echo $script_name
echo "-------"
echo "script_dir:"
echo $script_dir
echo "-------"
echo "build_path_packer:"
echo $build_path_packer
echo "-------"
echo "build_path_terraform:"
echo $build_path_terraform
echo "-------"
echo "current_dir:"
echo $current_dir
echo "-------"
# azure_managed_image_version=$(cat ./VERSION | xargs)
echo "creating image gallery"
cd $build_path_terraform/_image_gallery && ./build.sh
for d in $build_path_terraform/!(_*|.*)/
do
azure_managed_image_name=$(basename "$d")
echo $azure_managed_image_name
cd $build_path_terraform/$azure_managed_image_name && ./build.sh &
done
wait
for d in $build_path_packer/!(_*|.*)/
do
azure_managed_image_name=$(basename "$d")
echo $azure_managed_image_name
cd $build_path_packer/$azure_managed_image_name && ./build.sh &
done
wait
cd $current_dir