simple load sample manager in command line

This commit is contained in:
Jean-Marie Renouard 2019-09-26 23:51:27 +02:00
parent 982410d6e1
commit fedc925111
3 changed files with 53 additions and 0 deletions

2
.gitignore vendored
View file

@ -7,3 +7,5 @@ build/vulnerabilities*
Vagrant/Vagrantfile
Vagrant/data
Vagrant/.vagrant
contents
contents/*

25
build/fetchDatabase.sh Normal file
View file

@ -0,0 +1,25 @@
#!/bin/sh
DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip"
DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip"
DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip"
DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip"
DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip"
getVal()
{
local vari=$1
eval "echo \$$vari"
}
case "$1" in
"fetch")
mkdir -p ./contents
wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL")
;;
"load")
;;
*)
echo "Unknown operation: $1"
;;
esac

26
build/manageSamples.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/sh
DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip"
DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip"
DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip"
DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip"
DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip"
getVal()
{
local vari=$1
eval "echo \$$vari"
}
case "$1" in
"fetch")
set -x
mkdir -p ./contents
wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL")
;;
"load")
;;
*)
echo "Unknown operation: $1"
;;
esac