Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 3e6b962

Browse files
authored
Merge pull request #28 from startupturbo/dmius-nancy-cli
Dmius nancy cli
2 parents 58ef40f + 755adb7 commit 3e6b962

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

nancy

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
cmd=""
4+
5+
case "$1" in
6+
help )
7+
echo -e "
8+
\033[1mDESCRIPTION\033[22m
9+
10+
The Nancy Command Line Interface is a unified way to manage
11+
database experiments.
12+
13+
Nancy is a member of Postgres.ai's Artificial DBA team
14+
responsible for conducting experiments.
15+
16+
\033[1mSYNOPSYS\033[22m
17+
18+
nancy <command> [parameters]
19+
20+
\033[1mAVAILABLE COMMANDS\033[22m
21+
22+
* help
23+
24+
* prepare-database
25+
26+
* prepare-workload
27+
28+
* run
29+
" | less -RFX
30+
exit 1;
31+
;;
32+
* )
33+
if [ ! -f "${BASH_SOURCE%/*}/nancy_$1.sh" ]
34+
then
35+
>&2 echo "ERROR: Unknown command."
36+
exit 1;
37+
fi
38+
cmd="${BASH_SOURCE%/*}/nancy_$1.sh"
39+
shift;
40+
;;
41+
esac
42+
43+
while [ -n "$1" ]
44+
do
45+
cmd="$cmd $1"
46+
shift
47+
done
48+
49+
echo "CMD: $cmd"
50+
51+
${cmd}
52+

tests/nancy_cli_run.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
export PATH=$PATH:${BASH_SOURCE%/*}/..
4+
5+
output=$(nancy run --run-on aws 2>&1)
6+
7+
if [[ $output =~ "ERROR: AWS keys not given" ]]; then
8+
echo -e "\e[36mOK\e[39m"
9+
else
10+
>&2 echo -e "\e[31mFAILED\e[39m"
11+
exit 1
12+
fi

tests/nancy_cli_run_no_optons.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
output=$(${BASH_SOURCE%/*}/../nancy run --run-on aws 2>&1)
4+
5+
if [[ $output =~ "ERROR: AWS keys not given" ]]; then
6+
echo -e "\e[36mOK\e[39m"
7+
else
8+
>&2 echo -e "\e[31mFAILED\e[39m"
9+
exit 1
10+
fi

tests/nancy_cli_unknown.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
output=$(${BASH_SOURCE%/*}/../nancy init --run-on aws 2>&1)
4+
5+
if [[ $output =~ "ERROR: Unknown command" ]]; then
6+
echo -e "\e[36mOK\e[39m"
7+
else
8+
>&2 echo -e "\e[31mFAILED\e[39m"
9+
exit 1
10+
fi

0 commit comments

Comments
 (0)