-
Notifications
You must be signed in to change notification settings - Fork 0
/
uhd.sh
executable file
·84 lines (68 loc) · 2.21 KB
/
uhd.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
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
root=$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)
for script_file in "$root"/scripts/_*.sh; do
source $script_file
done
function _uhd_commands_help() {
echo
echo " █░█ █▄▀ █░█ █▀ ▄▀█ "
echo " █▄█ █░█ █▀█ ▄█ █▀█ "
echo
echo " █▀▄ ▄▀█ ▀█▀ ▄▀█ █▀▄ ▄▀█ █▀ █░█ █▄▄ █▀█ ▄▀█ █▀█ █▀▄ "
echo " █▄▀ █▀█ ░█░ █▀█ █▄▀ █▀█ ▄█ █▀█ █▄█ █▄█ █▀█ █▀▄ █▄▀ "
echo
echo " █▀▀ █░░ █"
echo " █▄▄ █▄▄ █"
echo
echo " UKHSA Data Dashboard CLI Tool"
echo
echo "uhd <command> [options]"
echo
echo "commands:"
echo " help - this help screen"
echo
echo " aws - aws commands"
echo " cache - cache commands"
echo " data - upload and ingest metric data"
echo " docker - docker commands"
echo " ecs - aws ecs commands"
echo " gh - github commands"
echo " lambda - aws lambda commands"
echo " terraform - terraform commands"
echo " secrets - aws secrets commands"
echo
echo " update - update all the things - infra, containers, etc"
echo
return 0
}
function uhd() {
if [ $CI ]; then
echo $0 $@
fi
local current=$(pwd)
local command=$1
local args=(${@:2})
cd $root
case $command in
"aws") _aws $args ;;
"cache") _cache $args ;;
"data") _data $args ;;
"docker") _docker $args ;;
"ecs") _ecs $args ;;
"gh") _gh $args ;;
"lambda") _lambda $args ;;
"terraform") _terraform $args ;;
"secrets") _secrets $args ;;
"update") _update $args ;;
*) _uhd_commands_help ;;
esac
local exit_code=$?
cd $current
return $exit_code
}
echo
echo "uhd cli loaded"
echo
echo "Type uhd for the help screen"
echo
return 0