11#! /bin/bash
2- echo ' Validating jd installation..'
3- /usr/bin/jq --help > /dev/null 2>&1
4- if [ $? -ne 0 ]; then
5- echo ' Installing'
6- # download directly into ~/bin_compciv
7- sudo curl http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq
8- # give it executable permissions
9- sudo chmod a+x /usr/bin/jq
10- fi
2+ # -----------------------------------------------------------------------------
3+ # Current file variables
4+ # -----------------------------------------------------------------------------
5+ debug=false
6+ parent_folder=" ../"
7+ current_path=$( pwd)
8+ current_path_basename=$( basename $( pwd) )
9+ current_file_full_path=$0
10+ # echo $current_filepath
11+ current_file_name=$( basename -- " $0 " )
12+ # echo $current_filename
13+ if [ $current_file_full_path = $current_file_name ] || [ $current_file_full_path = " ./$current_file_name " ]; then
14+ current_file_full_path=" ./${current_file_full_path} "
15+ current_file_path=" ./"
16+ else
17+ current_file_path=" ${current_file_full_path/ $current_file_name / ' ' } "
18+ fi
19+ if [ debug ]; then
20+ echo ' ----------------------------------------'
21+ echo " $0 - Script variables"
22+ echo ' ----------------------------------------'
23+ echo " current_path: $current_path "
24+ echo " current_path_basename: $current_path_basename "
25+ echo " current_file_full_path: $current_file_full_path "
26+ echo " current_file_name: $current_file_name "
27+ echo " current_file_path: $current_file_path "
28+ echo ' ----------------------------------------'
29+ fi
1130
12- echo ' Validate connection'
13- ./scripts/boot-validate-connection.sh
31+ echo ' ----------------------------------------'
32+ echo " $0 - jq check"
33+ echo ' ----------------------------------------'
34+ echo ' Validating jq installation...'
35+ /usr/bin/jq --version > /dev/null 2>&1
36+ if [ $? -ne 0 ]; then
37+ echo ' Installing jq...'
38+ # download directly into ~/bin_compciv
39+ sudo curl http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq
40+ # give it executable permissions
41+ sudo chmod a+x /usr/bin/jq
42+ else
43+ echo ' jq installed...'
44+ fi
1445
15- echo ' Create the lambdas...'
16- ./scripts/boot-lambdas.sh
46+
47+ echo ' ----------------------------------------'
48+ echo " $0 - Localstack connection check"
49+ echo ' ----------------------------------------'
50+ # valida se o Localstack está rodando
51+ if test -f ${current_file_path} boot-validate-connection.sh; then
52+ echo ' Validate connection...'
53+ ${current_file_path} boot-validate-connection.sh
54+ else
55+ echo ' There is no connection check'
56+ fi
57+
58+
59+ echo ' ----------------------------------------'
60+ echo " $0 - Database boot"
61+ echo ' ----------------------------------------'
62+ if test -f ${current_file_path} boot-db.sh; then
63+ ${current_file_path} boot-db.sh
64+ else
65+ echo ' There is no database to be booted'
66+ fi
67+
68+ echo ' ----------------------------------------'
69+ echo " $0 - Queues boot"
70+ echo ' ----------------------------------------'
71+ if test -f ${current_file_path} boot-queues.sh; then
72+ ${current_file_path} boot-queues.sh
73+ else
74+ echo ' There is no queues to be booted'
75+ fi
76+
77+ echo ' ----------------------------------------'
78+ echo " $0 - Lambdas boot"
79+ echo ' ----------------------------------------'
80+ if test -f ${current_file_path} boot-lambdas.sh; then
81+ ${current_file_path} boot-lambdas.sh
82+ else
83+ echo ' There is no lambdas to be booted'
84+ fi
0 commit comments