File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
provisioner/terraform/testdata/bin Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ VERSION=$1
4
+ MODE=$2
5
+ shift 2
6
+
7
+ json_print () {
8
+ echo " {\" @level\" :\" error\" ,\" @message\" :\" $* \" }"
9
+ }
10
+
11
+ case " $1 " in
12
+ version)
13
+ cat << -EOF
14
+ {
15
+ "terraform_version": "${VERSION} ",
16
+ "platform": "linux_amd64",
17
+ "provider_selections": {},
18
+ "terraform_outdated": false
19
+ }
20
+ EOF
21
+ exit 0
22
+ ;;
23
+ init)
24
+ case " $MODE " in
25
+ apply)
26
+ echo " init"
27
+ ;;
28
+ init)
29
+ sleep 10 &
30
+ sleep_pid=$!
31
+
32
+ trap ' echo exit; kill -9 $sleep_pid 2>/dev/null' EXIT
33
+ trap ' echo interrupt; exit 1' INT
34
+ trap ' echo terminate"; exit 2' TERM
35
+
36
+ echo init_start
37
+ wait
38
+ echo init_end
39
+ ;;
40
+ esac
41
+ ;;
42
+ apply)
43
+ sleep 10 &
44
+ sleep_pid=$!
45
+
46
+ trap ' json_print exit; kill -9 $sleep_pid 2>/dev/null' EXIT
47
+ trap ' json_print interrupt; exit 1' INT
48
+ trap ' json_print terminate"; exit 2' TERM
49
+
50
+ json_print apply_start
51
+ wait
52
+ json_print apply_end
53
+ ;;
54
+ plan)
55
+ echo " plan not supported"
56
+ exit 1
57
+ ;;
58
+ esac
59
+
60
+ exit 0
You can’t perform that action at this time.
0 commit comments