forked from wanghong230/goexample
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaxyamlcheck.sh
More file actions
executable file
·67 lines (60 loc) · 1.19 KB
/
Copy pathaxyamlcheck.sh
File metadata and controls
executable file
·67 lines (60 loc) · 1.19 KB
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
#!/bin/bash
function usage {
echo "Usage"
echo "$0 [options] .applatix-directory"
echo
echo "Options:"
echo " -d Enable debug mode to print out the internal service templates converted from the yaml specs."
echo " -p url"
echo " Post all yaml files to the specified axops server url, e.g. http://axops:8085/v1"
echo
}
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-d)
debug_option="$key"
shift
;;
-h|--help)
usage
exit 0
;;
-p)
post_option="-p ${2}"
shift
shift # past argument
;;
-*)
unknown_key="$key"
break
;;
*)
src_dir="$key"
shift
;;
esac
done
if [ -n "$unknown_key" ]
then
echo
echo Invalid option: "$unknown_key"
echo
usage
exit 1
fi
if [ -z "$src_dir" ]
then
usage
exit 1
fi
SRC_DIR="$(cd "${src_dir}" && pwd)"
if [ -z ${SRC_DIR} ]
then
echo
echo Invalid directory: ${src_dir}
usage
exit 1
fi
docker run -v "$SRC_DIR":"$SRC_DIR" docker.applatix.io/axops:latest /axops/bin/axyamlcheck ${debug_option} ${post_option} ${SRC_DIR}