Skip to content

Commit fedc925

Browse files
committed
simple load sample manager in command line
1 parent 982410d commit fedc925

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ build/vulnerabilities*
77
Vagrant/Vagrantfile
88
Vagrant/data
99
Vagrant/.vagrant
10+
contents
11+
contents/*

build/fetchDatabase.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
4+
DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip"
5+
DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip"
6+
DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip"
7+
DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip"
8+
DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip"
9+
10+
getVal()
11+
{
12+
local vari=$1
13+
eval "echo \$$vari"
14+
}
15+
case "$1" in
16+
"fetch")
17+
mkdir -p ./contents
18+
wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL")
19+
;;
20+
"load")
21+
;;
22+
*)
23+
echo "Unknown operation: $1"
24+
;;
25+
esac

build/manageSamples.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
4+
DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip"
5+
DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip"
6+
DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip"
7+
DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip"
8+
DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip"
9+
10+
getVal()
11+
{
12+
local vari=$1
13+
eval "echo \$$vari"
14+
}
15+
case "$1" in
16+
"fetch")
17+
set -x
18+
mkdir -p ./contents
19+
wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL")
20+
;;
21+
"load")
22+
;;
23+
*)
24+
echo "Unknown operation: $1"
25+
;;
26+
esac

0 commit comments

Comments
 (0)